NEC UNIVERGE IX ルータにおけるGRE tunnelの設定例を紹介します。GREは最も汎用的な平文トンネルで、VPNとして使用したりIPv6パケットをカプセル化したりする用途で使用します。基本的な技術説明については、NEC IX GRE 設定方法を参照下さい。
動作確認環境
以下の構成で動作確認を行います。
[R1:IX2215] interface GigaEthernet0.0 ip address 200.0.12.1/24 ! interface GigaEthernet1.0 ip address 192.168.1.1/24 ! interface Loopback0.0 ip address 10.1.1.1/32 ! ip route default 200.0.12.2 [R2:Cisco3640] interface Loopback0 ip address 200.2.2.2 255.255.255.255 ! interface Ethernet0/0 ip address 200.0.12.2 255.255.255.0 ! interface Ethernet0/1 ip address 200.0.23.2 255.255.255.0 [R3:Cisco3640] interface Loopback0 ip address 10.3.3.3 255.255.255.255 ! interface Ethernet0/0 ip address 200.0.23.3 255.255.255.0 ! interface Ethernet0/1 ip address 192.168.3.3 255.255.255.0 no keepalive ! ip route 0.0.0.0 0.0.0.0 200.0.23.2
初期設定の全文は以下を参照下さい。
GRE トンネルの作成
IX側 設定投入
NEC UNIVERGE IXルータ R1にGREの設定を投入します。トンネルインターフェースのIPアドレスは192.168.13.1/24を使用します。
[R1:IX2215] interface Tunnel0.0 tunnel mode gre ip tunnel destination 200.0.23.3 tunnel source GigaEthernet0.0 ip address 192.168.13.1/24 no shutdown
Cisco側 設定投入
Ciscoルータ R3にGREの設定を投入します。トンネルインターフェースのIPアドレスは192.168.13.3/24を使用します。
[R3:Cisco3640] interface Tunnel0 ip address 192.168.13.3 255.255.255.0 tunnel source Ethernet0/0 tunnel destination 200.0.12.1
疎通確認
R1, R3間でGRE経由の疎通が可能である事を確認します。
[R1:IX2215] R1(config)# ping 192.168.13.3 PING 192.168.13.1 > 192.168.13.3 56 data bytes 64 bytes from 192.168.13.3: icmp_seq=0 ttl=255 time=43.552 ms 64 bytes from 192.168.13.3: icmp_seq=1 ttl=255 time=23.361 ms 64 bytes from 192.168.13.3: icmp_seq=2 ttl=255 time=42.579 ms --- 192.168.13.3 ping statistics --- 3 packets transmitted, 3 packets received, 0% packet loss round-trip (ms) min/avg/max = 23.361/36.497/43.552 R1(config)#
ルーティング
OSPF設定
GREを経由したダイナミックルーティングが可能である事を確かめるためにOSPFを設定します。以下の設定をCiscoルータ R1とNEC UNIVERGE IXルータ R3に投入します。Cisco, NECの組み合わせではトラブルにはなりませんが、機種によってはトンネル内通信でマルチキャストをエミュレートしない事もあるので注意して下さい。
[R1:IX2215] ip router ospf 1 network Tunnel0.0 area 0 network GigaEthernet1.0 area 0 network Loopback0.0 area 0 [R3:Cisco3640] router ospf 1 network 10.3.3.3 0.0.0.0 area 0 network 192.168.3.3 0.0.0.0 area 0 network 192.168.13.3 0.0.0.0 area 0
疎通確認
OSPFによる経路交換ができている事を確認します。
[R1:IX2215] R1(config)# show ip route ospf IP Routing Table - 2 entries, 5 hidden, 2041 frees Entries: 0 Connected, 0 Static, 0 RIP, 2 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 O 10.3.3.3/32 [110/11] via 192.168.13.3, Tunnel0.0, 0:01:03 O 192.168.3.0/24 [110/20] via 192.168.13.3, Tunnel0.0, 0:01:13 R1(config)#
OSPFで交換した経路について疎通可能である事を確認します。R1 Lo0からR3 Lo0への疎通を確認します。
R1(config)# ping 10.3.3.3 source 10.1.1.1 PING 10.1.1.1 > 10.3.3.3 56 data bytes 64 bytes from 10.3.3.3: icmp_seq=0 ttl=255 time=53.841 ms 64 bytes from 10.3.3.3: icmp_seq=1 ttl=255 time=63.683 ms 64 bytes from 10.3.3.3: icmp_seq=2 ttl=255 time=62.716 ms --- 10.3.3.3 ping statistics --- 3 packets transmitted, 3 packets received, 0% packet loss round-trip (ms) min/avg/max = 53.841/60.080/63.683 R1(config)#
GRE unnumbered
GRE unnumbered 設定投入
IPアドレスをunnumberedと指定する事もできます。R1, R3のトンネルインターフェースについてIPアドレスをunnumberedとします。
[R1:IX2215] interface Tunnel0 ip unnumbered Loopback0 [R3:Cisco3640] interface Tunnel0.0 ip unnumbered Loopback0.0 ! router ospf 1 no network 192.168.13.3 0.0.0.0 area 0
GRE unnumbered 設定確認
NEC UNIVERGE IXルータのIPアドレスがunnumberedと設定された事を確認します。
[R1:IX2215] R1(config)# show ip interface Tunnel0.0 Interface Tunnel0.0 is up, line protocol is up Interface is unnumbered. Using address of Loopback0.0 (10.1.1.1) MTU is 1476 octets Directed broadcast forwarding is disabled Multicast reserved groups joined: 224.0.0.5 Proxy ARP is disabled Local proxy ARP is disabled ICMP redirects are never sent IGMP is disabled TCP MSS adjustment is disabled R1(config)#
NEC UNIVERGE IXルータのルーティングテーブルを確認します。OSPFによって交換したルートについて、nexthopではなく”directly connected”と表示されるようになった事を確認します。
[R1:IX2215] R1(config)# show ip route ospf IP Routing Table - 2 entries, 4 hidden, 2042 frees Entries: 0 Connected, 0 Static, 0 RIP, 2 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 O 10.3.3.3/32 [110/11] is directly connected, Tunnel0.0, 0:01:10 O 192.168.3.0/24 [110/20] is directly connected, Tunnel0.0, 0:01:10 R1(config)#
GRE unnumbered 疎通確認
Host100からR3 e0/1への疎通を確認します。
[Host100:Windows7] C:\\Users\\Host100>ping 192.168.3.3 192.168.3.3 に ping を送信しています 32 バイトのデータ: 192.168.3.3 からの応答: バイト数 =32 時間 =70ms TTL=254 192.168.3.3 からの応答: バイト数 =32 時間 =67ms TTL=254 192.168.3.3 からの応答: バイト数 =32 時間 =54ms TTL=254 192.168.3.3 からの応答: バイト数 =32 時間 =41ms TTL=254 192.168.3.3 の ping 統計: パケット数: 送信 = 4、受信 = 4、損失 = 0 (0% の損失)、 ラウンド トリップの概算時間 (ミリ秒): 最小 = 41ms、最大 = 70ms、平均 = 58ms C:\\Users\\Host100>