IPsecを伴ったL2トンネリング/ブリッジ
(いつの間にか本シリーズも第10回に突入)
その9の続編。IPsecを用いてトンネリング部分を暗号化する。
トポロジー
同一セグメント(10.0.0.0/24)のトンネリング区間(R2-R3)をIPsec化する。末端のPCには固定IPアドレスをアサインする。
設定
PC1およびPC2は自明のため省略。
R2
L2トンネリングについては、その9の説明参照。
pseudowire-class test
encapsulation l2tpv3
ip local interface FastEthernet0/0
interface FastEthernet0/1
no ip address
xconnect 192.168.2.2 1 encapsulation l2tpv3 manual pw-class test
l2tp id 1 2
ip route 0.0.0.0 0.0.0.0 FastEthernet0/0
IKEおよびIPSecの詳細については、「その4:トンネリング:IPsec」の説明を参照。IKEおよびIPsecの接続先として、対向ルーターであるR3のIPアドレスを指定する。
crypto isakmp policy 1
encr aes
authentication pre-share
group 2
crypto isakmp key testpwd address 192.168.2.2
crypto isakmp keepalive 60 periodic
crypto ipsec transform-set ABC esp-aes esp-sha-hmac
mode transport
IKEおよびIPsecを適用するマップの設定。暗号化の対象をプロトコル番号「115」(L2TP)としている。プロトコル番号については、プロトコル番号 ( IP Protocol Number )を参照。
crypto map To_R3 1 ipsec-isakmp
set peer 192.168.2.2
set transform-set ABC
match address DEF
ip access-list extended DEF
permit 115 any any
接続先となる物理I/Fに上述したマップを適用する。
interface FastEthernet0/0
ip address 192.168.1.2 255.255.255.0
crypto map To_R3
R3
R2とほぼ同じのため、説明省略。
pseudowire-class test
encapsulation l2tpv3
ip local interface FastEthernet0/0
crypto isakmp policy 1
encr aes
authentication pre-share
group 2
crypto isakmp key testpwd address 192.168.1.2
crypto isakmp keepalive 60 periodic
crypto ipsec transform-set ABC esp-aes esp-sha-hmac
mode transport
crypto map To_R2 1 ipsec-isakmp
set peer 192.168.1.2
set transform-set ABC
match address DEF
interface FastEthernet0/0
ip address 192.168.2.2 255.255.255.0
crypto map To_R2
interface FastEthernet0/1
no ip address
xconnect 192.168.1.2 1 encapsulation l2tpv3 manual pw-class test
l2tp id 2 1
ip route 0.0.0.0 0.0.0.0 FastEthernet0/0
ip access-list extended DEF
permit 115 any any
R1
自明。
interface FastEthernet0/0
ip address 192.168.1.1 255.255.255.0
interface FastEthernet0/1
ip address 192.168.2.1 255.255.255.0
検証
PC1からPC2へのping
PC1-R2のWiresharkデータ。ARPおよびICMP(ping)。当然ながら暗号化されていない。