はじめに
- IPsec トンネル上で GRE トンネルを構築します
- UNIVERGE IX においては IPsec と GRE の 2 つを終端し、対向側では IPsec と GRE それぞれを異なるルータで終端することとします
- IPsec トンネルがダウンしている間は GRE パケットが出力されないようにします
作業環境
■UNIVERGE IX
- 型番:UNIVERGE IX2106
- バージョン:10.2.16
■対向ルータ
- 型番:Cisco C891FJ-K9
- バージョン:15.3(3)M5
ネットワーク構成
IPsec 設定
IPsec 設計
項目 | IKE フェーズ1 | IKE フェーズ2 |
セキュリティプロトコル | – | esp |
暗号化アルゴリズム | 3des | 3des |
ハッシュアルゴリズム | sha1 | – |
認証方式/認証アルゴリズム | pre-share | esp-sha-hmac |
DH/PFS グループ | 1 | 無効 |
ISAKMP/IPsec SA ライフタイム | 86400秒 | 3600秒 |
Pre-shared Key | password | – |
IPsec 通信モード | – | tunnel |
IKE キープアライブ(DPD) | 無効 | – |
IPsec の対象トラフィック | – | ANY ⇔ ANY |
IKE モード | Main | Quick |
ISAKMP/IPsec のピアアドレス | 200.1.1.1 (200.1.1.2) | 200.1.1.1 (200.1.1.2) |
IX2106 の設定
※IPsec 関係の設定を抜粋
# IKE 設定
ike proposal ike_prop encryption 3des hash sha lifetime 86400
ike policy ike_pol peer 200.1.1.2 key password ike_prop
#IPsec 設定
ip access-list ips_acl permit ip src any dest any
ipsec autokey-proposal ips_prop esp-3des esp-sha lifetime time 3600
ipsec autokey-map ips_map ips_acl peer 200.1.1.2 ips_prop
#インターフェース設定
interface GigaEthernet0.0
ip address 200.1.1.1/30
no shutdown
interface Tunnel0.0
tunnel mode ipsec
ip unnumbered GigaEthernet0.0
ipsec policy tunnel ips_map out
no shutdown
ルータ1 の設定
※IPsec 関係の設定を抜粋
# IKE ポリシーの設定(IKE フェーズ 1)
crypto isakmp policy 1
authentication pre-share
encryption 3des
group 1
hash sha
lifetime 86400
# 共通鍵の指定 (password) と対向ルータのIPアドレス (200.1.1.1) の設定
crypto isakmp key password address 200.1.1.1
# IPsec トランスフォーム (TF-SET) の設定
crypto ipsec transform-set TF-SET esp-3des esp-sha-hmac
mode tunnel
# IPsec トラフィックの送信元と送信先の定義
ip access-list extended A-ipsec
permit ip any any
# 暗号 MAP の設定(IKEフェーズ2の設定)
crypto map CP-MAP 1 ipsec-isakmp
match address A-ipsec
set peer 200.1.1.1
set transform-set TF-SET
set security-association lifetime seconds 3600
# インタフェースへ IPsec ポリシーを適用
interface fastEthernet0
crypto map CP-MAP
GRE 設定
GRE 設計
項目 | IX2106 | ルータ2(C891FJ) |
トンネルIF | Tunnel1.0 | Tunnel0 |
モード | gre ip | gre |
destination | 10.10.0.2 | 200.1.1.1 (※2) |
source | Tunnel0.0 (※1) | GigabitEthernet8 |
ip address | 10.99.1.1/30 | 10.99.1.2/30 |
(※1) IX2106 のソースは IPsec トンネルインターフェースとします
(※2) IX2106 の IPsec トンネルインターフェースの IP アドレスとします
IX2106 の設定
※GRE 関係の設定を抜粋
#インターフェース設定
interface Tunnel1.0
tunnel mode gre ip
tunnel destination 10.10.0.2
tunnel source Tunnel0.0
ip address 10.99.1.1/30
no shutdown
#ルーティング設定
ip route 10.10.0.0/30 Null0.0 metric 2
ip route 10.10.0.0/30 Tunnel0.0
ip route 10.10.3.0/24 Tunnel1.0
ip route 10.10.0.0/30 Tunnel0.0
によって GRE パケットを IPsec トンネルを通して送信させますip route 10.10.0.0/30 Null0.0 metric 2
によって IPsec トンネルがダウンしている間は GRE パケットを Null インターフェースから送信(破棄)させます
ルータ2 の設定
※GRE 関係の設定を抜粋
#インターフェース設定
interface Tunnel0
ip address 10.99.1.2 255.255.255.252
tunnel source GigabitEthernet8
tunnel destination 200.1.1.1
#ルーティング設定
ip route 192.168.1.0 255.255.255.0 Tunnel0
ip route 200.1.1.0 255.255.255.252 10.10.0.1
動作確認
ネットワーク構成(再掲)
端末A から 端末B への通信確認
ping と tracert を行います。
GRE トンネルを通るルートになっていることが確認できます。
IX2106 のルーティングテーブルの確認
◆正常時
Router(config)# show ip route
IP Routing Table - 5 entries, 3 hidden, 2040 frees
Entries: 3 Connected, 2 Static, 0 RIP, 0 OSPF, 0 BGP
Codes: C - Connected, S - Static, R - RIP, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, B - BGP
* - Candidate default, s - Summary
Timers: Age
10.0.0.0/8 is subnetted, 3 subnets
S 10.10.0.0/30 [1/1] is directly connected, Tunnel0.0, 0:00:03
S 10.10.3.0/24 [1/1] is directly connected, Tunnel1.0, 0:00:03
C 10.99.1.0/30 [0/0] is directly connected, Tunnel1.0, 0:00:03
C 192.168.1.0/24 [0/0] is directly connected, GigaEthernet1.0, 11:39:18
200.1.1.0/24 is subnetted, 1 subnets
C 200.1.1.0/30 [0/0] is directly connected, GigaEthernet0.0, 0:15:21
10.10.0.0/30 宛の出力インターフェースが Tunnel0.0
になっていることが確認できます。
◆Tunnel0.0
を shutdown
した場合
Router(config)# show ip route
IP Routing Table - 5 entries, 3 hidden, 2040 frees
Entries: 3 Connected, 2 Static, 0 RIP, 0 OSPF, 0 BGP
Codes: C - Connected, S - Static, R - RIP, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, B - BGP
* - Candidate default, s - Summary
Timers: Age
10.0.0.0/8 is subnetted, 3 subnets
S 10.10.0.0/30 [1/2] is directly connected, Null0.0, 0:00:09
S 10.10.3.0/24 [1/1] is directly connected, Tunnel1.0, 0:00:09
C 10.99.1.0/30 [0/0] is directly connected, Tunnel1.0, 0:00:09
C 192.168.1.0/24 [0/0] is directly connected, GigaEthernet1.0, 11:42:14
200.1.1.0/24 is subnetted, 1 subnets
C 200.1.1.0/30 [0/0] is directly connected, GigaEthernet0.0, 0:18:17
10.10.0.0/30 宛の出力インターフェースが Null0.0
に変わっていることが確認できます。
このとき、端末間では通信できなくなります。
機器状態確認
IX2106 IPsec 状態確認
Router(config)# show ike sa
ISAKMP SA - 1 configured, 1 created
Local address is 200.1.1.1, port is 500
Remote address is 200.1.1.2, port is 500
IKE policy name is ike_pol
Direction is responder
Initiator's cookie is 0xb9c68f6003ed27b2
Responder's cookie is 0xea41238710f82e12
Exchange type is main mode
State is established
Authentication method is pre-shared
Encryption algorithm is 3des
Hash algorithm is sha1
DH group is modp768, lifetime is 84577 seconds
#ph1 success: 1, #ph1 failure: 0
#ph1 hash err: 0, #ph1 timeout: 0, #ph1 resend: 0
#ph2 success: 1, #ph2 failure: 0
#ph2 hash err: 0, #ph2 timeout: 0, #ph2 resend: 0
Router(config)# show ipsec sa
IPsec SA - 1 configured, 2 created
Interface is Tunnel0.0
Key policy map name is ips_map
Tunnel mode, 4-over-4, autokey-map
Local address is 200.1.1.1
Remote address is 200.1.1.2
Outgoing interface is GigaEthernet0.0
Interface MTU is 1446, path MTU is 1500
Inbound:
ESP, SPI is 0x5f400118(1598030104)
Transform is ESP-3DES-HMAC-SHA-96
Remaining lifetime is 1738 seconds, lifebyte is 999787572 bytes
Replay detection support is on
Outbound:
ESP, SPI is 0xcb85dc6b(3414547563)
Transform is ESP-3DES-HMAC-SHA-96
Remaining lifetime is 1738 seconds, lifebyte is 999757280 bytes
Replay detection support is on
Perfect forward secrecy is off
IX2106 トンネル状態確認
Router(config)# show tunnel status
Interface Tunnel0.0
Tunnel mode is ipsec (4-over-4)
Tunnel is ready
Destination address is 200.1.1.2
Source address is 200.1.1.1
Outgoing interface is GigaEthernet0.0
Interface MTU is 1446
Path MTU is 1500
Statistics:
4382 packets input, 518392 bytes, 0 errors
5662 packets output, 754288 bytes, 3 errors
Received ICMP messages:
0 errors
0 network unreachable
0 host unreachable
0 protocol unreachable
0 fragmentation needed
0 TTL exceeded
0 parameter problem
Interface Tunnel1.0
Tunnel mode is gre ip
Tunnel is ready
Destination address is 10.10.0.2
Source address is 200.1.1.1
Source interface GigaEthernet0.0
Outgoing interface is Tunnel0.0
Interface MTU is 1422
Path MTU is 1446
Statistics:
5909 packets input, 537732 bytes, 0 errors
4725 packets output, 399908 bytes, 0 errors
GRE statistics:
0 incorrect key received
0 incorrect checksum received
0 keepalive sent, 0 reply received
0 keepalive received, 0 reply sent
Last sent sequence number 0
Last received sequence number 0
Bridged packets:
0 encaps, 0 decaps
IPv4 packets:
4725 encaps, 5909 decaps
IPv6 packets:
0 encaps, 0 decaps
Received ICMP messages:
0 errors
0 network unreachable
0 host unreachable
0 protocol unreachable
0 fragmentation needed
0 TTL exceeded
0 parameter problem
―――――――――――――