LoginSignup
11
8

More than 5 years have passed since last update.

SoftLayerのVyattaでL2TP/IPsecを試してみた

Last updated at Posted at 2015-01-12

SoftLayerで提供されるVyatta Gateway Appliance(以下VGA)を使ってL2TP/IPsecでRemote Accessを構成し、SoftLayerのPrivate Networkにアクセスする構成を試してみました。L2TP/IPsecはサイト間のVPNではなく、PCそれぞれがVPN接続をしてリモートサイトにアクセスする形となり、接続時にはユーザー認証が行われます。

(2015/06/24追記)

最初に記事を書いた時点の最新バージョンVSE6.7R5では、NAT traversalが有効で、NATされた環境からL2TP/IPsecで接続される場合、複数VPNセッションが確立できないという問題がありましたが、最新のVSE6.7R8では修正されていることを確認しました。

L2TP/IPsecを使うメリット

SoftLayerでは、管理用に共用のSSL-VPN接続を提供しているのであまり使うケースがないかもしれませんが、以下のような特長があります。

  • より高速なスループットが期待できる
    管理用や開発用の環境で大量のISOイメージなどを転送する場合、管理用のSSL-VPNからよりも、インターネット側からRemote AccessでSoftLayer環境に接続するほうが、より高速なスループットが期待できる。

  • RADIUS認証が可能
    また、今回は試していませんがRADIUS認証も可能なので、既存のActive DirectoryのユーザーでRemote Accessの認証をさせることもできます。

  • クライアント側の追加ソフトウェアが不要
    L2TP/IPsecは、WindowsでもMac OS Xでもデフォルトでクライアントがインストールされているので、追加のソフトウェアが不要で、簡単に使うことができるのもメリットです。

検証結果

結果から言うと、2015/01時点でSoftLayerからVGAにデフォルトで提供されるバージョン(VSE(Vyatta Subscription Edition) R6.3)では、vyatta-pppパッケージが正しく導入されていないため、L2TP/IPsecでの接続は失敗しました(L2TPではPPPで認証を行います)。最新版のVSE 6.7R5では修正されいて正常に使えるので、アップグレードをチケットでSoftLayerに依頼してから設定を行ってください。

また、設定はVGAで試していますが、機能制限はないのでVyatta Community Editionでも同じことができると思います。

検証した環境

検証した環境は以下の通りです。

  • Vyatta: VSE6.7R5
  • クライアントOS: Windows 7 Professional (英語版) / Mac OS X
  • VyattaのPublic側アドレス:101.111.212.71
  • クライアントのIPアドレス:192.168.1.0/24
  • クライアントに割り当てるアドレスプール:192.168.10.10-192.168.10.20
  • ユーザー認証:Vyattaローカルのユーザーで認証

Vyatta設定

# IPsec configuration
set vpn ipsec ipsec-interfaces interface bond1
set vpn ipsec nat-traversal enable
set vpn ipsec nat-networks allowed-network 192.168.1.0/24
set vpn ipsec nat-networks allowed-network 192.168.13.0/24

# L2TP endpoints
set vpn l2tp remote-access outside-address 101.111.212.71
set vpn l2tp remote-access outside-nexthop 0.0.0.0

# L2TP client IP pool
set vpn l2tp remote-access client-ip-pool start 192.168.10.10
set vpn l2tp remote-access client-ip-pool stop 192.168.10.20

# IPsec authentication
set vpn l2tp remote-access ipsec-settings authentication mode pre-shared-secret
set vpn l2tp remote-access ipsec-settings authentication pre-shared-secret <pre shared key>

# L2TP authentication
set vpn l2tp remote-access authentication mode local
set vpn l2tp remote-access authentication local-users username user01 password <user01's password>
set vpn l2tp remote-access authentication local-users username user02 password <user02's password>

Windowsクライアント設定

Control Panel
> Network and Internet
> Network and Sharing Center
> Set Up a Connection or Network
> Connect to a workplace
> Next
> No, create a new connection
> Next
> Use my Internet connection (VPN)

l2tp-ipsec1.png

> Next

l2tp-ipsec2.png

> Create
> Close

タスクバーのConnectionから、作成したConnectionを右クリック
> Properties
> Securityタブ
> Type of VPNから"Layer 2 Tunneling Protocol with IPsec (L2TP/IPsec)"を選択

l2tp-ipsec3.png

> Advanced settings
l2tp-ipsec4.png

接続時のログ

接続時のログは/var/log/messages に出力されます。

/var/log/messages
Dec 30 08:05:18 vga01-paris pluto[7891]: packet from 101.111.212.71:500: received Vendor ID payload [RFC 3947]
Dec 30 08:05:18 vga01-paris pluto[7891]: packet from 101.111.212.71:500: ignoring Vendor ID payload [4df37928e9fc4fd1b3262170d515c662]
Dec 30 08:05:18 vga01-paris pluto[7891]: packet from 101.111.212.71:500: ignoring Vendor ID payload [8f8d83826d246b6fc7a8a6a428c11de8]
Dec 30 08:05:18 vga01-paris pluto[7891]: packet from 101.111.212.71:500: ignoring Vendor ID payload [439b59f8ba676c4c7737ae22eab8f582]
Dec 30 08:05:18 vga01-paris pluto[7891]: packet from 101.111.212.71:500: ignoring Vendor ID payload [4d1e0e136deafa34c4f3ea9f02ec7285]
Dec 30 08:05:18 vga01-paris pluto[7891]: packet from 101.111.212.71:500: ignoring Vendor ID payload [80d0bb3def54565ee84645d4c85ce3ee]
Dec 30 08:05:18 vga01-paris pluto[7891]: packet from 101.111.212.71:500: ignoring Vendor ID payload [9909b64eed937c6573de52ace952fa6b]
Dec 30 08:05:18 vga01-paris pluto[7891]: packet from 101.111.212.71:500: ignoring Vendor ID payload [draft-ietf-ipsec-nat-t-ike-03]
Dec 30 08:05:18 vga01-paris pluto[7891]: packet from 101.111.212.71:500: ignoring Vendor ID payload [draft-ietf-ipsec-nat-t-ike-02]
Dec 30 08:05:18 vga01-paris pluto[7891]: packet from 101.111.212.71:500: ignoring Vendor ID payload [draft-ietf-ipsec-nat-t-ike-02_n]
Dec 30 08:05:18 vga01-paris pluto[7891]: packet from 101.111.212.71:500: ignoring Vendor ID payload [FRAGMENTATION 80000000]
Dec 30 08:05:18 vga01-paris pluto[7891]: packet from 101.111.212.71:500: received Vendor ID payload [Dead Peer Detection]
Dec 30 08:05:18 vga01-paris pluto[7891]: "remote-access-mac-zzz"[17] 101.111.212.71 #17: responding to Main Mode from unknown peer 101.111.212.71
Dec 30 08:05:18 vga01-paris pluto[7891]: "remote-access-mac-zzz"[17] 101.111.212.71 #17: NAT-Traversal: Result using RFC 3947: peer is NATed
Dec 30 08:05:18 vga01-paris pluto[7891]: "remote-access-mac-zzz"[17] 101.111.212.71 #17: ignoring informational payload, type IPSEC_INITIAL_CONTACT
Dec 30 08:05:18 vga01-paris pluto[7891]: "remote-access-mac-zzz"[17] 101.111.212.71 #17: Peer ID is ID_IPV4_ADDR: '192.168.1.3'
Dec 30 08:05:18 vga01-paris pluto[7891]: "remote-access-mac-zzz"[18] 101.111.212.71 #17: deleting connection "remote-access-mac-zzz" instance with peer 101.111.212.71 {isakmp=#0/ipsec=#0}
Dec 30 08:05:18 vga01-paris pluto[7891]: "remote-access-mac-zzz"[18] 101.111.212.71:4500 #17: sent MR3, ISAKMP SA established
Dec 30 08:05:19 vga01-paris pluto[7891]: "remote-access-mac-zzz"[18] 101.111.212.71:4500 #18: NAT-Traversal: received 2 NAT-OA. using first, ignoring others
Dec 30 08:05:19 vga01-paris pluto[7891]: "remote-access-mac-zzz"[18] 101.111.212.71:4500 #18: responding to Quick Mode
Dec 30 08:05:19 vga01-paris pluto[7891]: "remote-access-mac-zzz"[18] 101.111.212.71:4500 #18: Dead Peer Detection (RFC 3706) enabled
Dec 30 08:05:19 vga01-paris pluto[7891]: "remote-access-mac-zzz"[18] 101.111.212.71:4500 #18: IPsec SA established {ESP=>0x0d1888cf <0xc61fbd57 NATOA=192.168.1.3}
Dec 30 08:05:19 vga01-paris xl2tpd[9245]: Connection established to 101.111.212.71, 56685.  Local: 3380, Remote: 11 (ref=0/0).  LNS session is 'default'
Dec 30 08:05:19 vga01-paris xl2tpd[9245]: Call established with 101.111.212.71, Local: 5345, Remote: 53463, Serial: 1
Dec 30 08:05:19 vga01-paris pppd[9339]: pppd 2.4.5 started by root, uid 0
Dec 30 08:05:19 vga01-paris Keepalived_vrrp: Netlink: filter function error
Dec 30 08:05:19 vga01-paris pppd[9339]: Connect: ppp0 <-->
Dec 30 08:05:21 vga01-paris pppd[9339]: Unsupported protocol 'IPv6 Control Protocol' (0x8057) received
Dec 30 08:05:21 vga01-paris pppd[9339]: Unsupported protocol 'Apple Client Server Protocol Control' (0x8235) received
Dec 30 08:05:21 vga01-paris Keepalived_vrrp: Netlink: filter function error
Dec 30 08:05:21 vga01-paris pppd[9339]: Cannot determine ethernet address for proxy ARP
Dec 30 08:05:21 vga01-paris pppd[9339]: local  IP address 10.255.0.0
Dec 30 08:05:21 vga01-paris pppd[9339]: remote IP address 192.168.10.10
11
8
6

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
8