L2TP(Layer 2 Tunneling Protocol)とは
L2TPは、インターネットなどの公衆回線上にVPNを張ることで遠隔地にあるLAN同士(同一セグメント)を接続することができます。
例として、自宅や出張先などから会社のネットワークに接続するリモートアクセス等で使用されることがあります。
L2TPはレイヤ2層の技術で、データの暗号化や認証の機能がないためIPsecなどの技術を組み合わせて使用することにより安全にインターネット上で通信することができます。
L2TPと似た技術としてCisco Systems社が開発したL2FやMicrosoftのPPTPがあります。
ネットワーク構成
L2TPv3を使用することで、離れた拠点にある同一セグメントのコンピュータが通信できるかを確認していきます。
※下図のInternetルータはInternetを想定したルータとなります。

L2TPの設定例
RT1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
hostname RT1 ! pseudowire-class L2TPv3 encapsulation l2tpv3 ip local interface Loopback0 ! interface Loopback0 ip address 1.1.1.1 255.255.255.255 ! interface GigabitEthernet0/0 no ip address xconnect 2.2.2.2 1 encapsulation l2tpv3 pw-class L2TPv3 ! interface GigabitEthernet0/1 ip address 10.0.0.1 255.255.255.252 ! router eigrp 1 network 1.1.1.1 0.0.0.0 network 10.0.0.0 0.0.0.3 |
RT2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
hostname RT2 ! pseudowire-class L2TPv3 encapsulation l2tpv3 ip local interface Loopback0 ! interface Loopback0 ip address 2.2.2.2 255.255.255.255 ! interface GigabitEthernet0/0 no ip address xconnect 1.1.1.1 1 encapsulation l2tpv3 pw-class L2TPv3 ! interface GigabitEthernet0/2 ip address 20.0.0.2 255.255.255.252 ! router eigrp 1 network 2.2.2.2 0.0.0.0 network 20.0.0.0 0.0.0.3 |
L2TPv3 の設定について説明します。
pseudowire-class [pseudowire-class-name]
L2TPv3 のパラメータを定義するための pseudowwire-class を作成します。
encapsulation l2tpv3
encapsulationコマンドでl2tpv3を指定します。
ip local interface [interface-name]
L2TPv3パケットの送信元IPアドレスを指定します。
xconnect [peer-ip-address] [vcid] encapsulation l2tpv3 pw-class [pseudowire-class-name]
peer-ip-address:対向L2TPv3ルータのIPアドレス
vcid:32 bitのVC(virtual circuit)識別子。対向L2TPv3ルータと同じ値を使用しなければなりません。
pseudowire-class-name:pseudowire-classで作成したpseudowire-class-nameを指定します。
Internet
1 2 3 4 5 6 7 8 9 10 11 |
hostname Internet ! interface GigabitEthernet0/1 ip address 10.0.0.2 255.255.255.252 ! interface GigabitEthernet0/2 ip address 20.0.0.1 255.255.255.252 ! router eigrp 1 network 10.0.0.0 0.0.0.3 network 20.0.0.0 0.0.0.3 |
動作確認
L2TPv3のtunnelが正常に張れているか確認する方法は「show xconnect all」または「show l2tp session」コマンドを使用します。
1 2 3 4 5 6 7 8 |
RT1#show xconnect all Legend: XC ST=Xconnect State S1=Segment1 State S2=Segment2 State UP=Up DN=Down AD=Admin Down IA=Inactive SB=Standby HS=Hot Standby RV=Recovering NH=No Hardware XC ST Segment 1 S1 Segment 2 S2 ------+---------------------------------+--+---------------------------------+-- UP pri ac Gi0/0:2(Ethernet) UP l2tp 2.2.2.2:1 UP |
show xconnect all の XC ST, S1, S2 が UP になっていることを確認してください。
1 2 3 4 5 6 7 |
RT1#show l2tp session L2TP Session Information Total tunnels 1 sessions 1 LocID RemID TunID Username, Intf/ State Last Chg Uniq ID Vcid, Circuit 521984605 1477454741 3951381085 1, Gi0/0 est 00:03:32 0 |
show l2tp session の State が est になっていることを確認してください。
1 2 3 4 5 6 7 |
PC1> ping 192.168.1.2 84 bytes from 192.168.1.2 icmp_seq=1 ttl=64 time=2.064 ms 84 bytes from 192.168.1.2 icmp_seq=2 ttl=64 time=8.236 ms 84 bytes from 192.168.1.2 icmp_seq=3 ttl=64 time=2.360 ms 84 bytes from 192.168.1.2 icmp_seq=4 ttl=64 time=1.536 ms 84 bytes from 192.168.1.2 icmp_seq=5 ttl=64 time=3.103 ms |
PC1とPC2間でPing疎通確認をします。同一セグメント上で通信ができればL2TPの設定は完了です。
No comments yet.