NEC IX static ルーティングの設定例 (IPv4とIPv6のデュアルスタック構成)

スポンサーリンク

NEC IX ルータにおけるIPv4, IPv6 static routeの設定例を紹介します。static routeを設定するには、ip route, ipv6 routeコマンドを使用します。

コマンド一覧

このシナリオで重要なコマンド一覧は以下の通りです。

Router(config)# ip route default <next_hop> [ <interface> ]
Router(config)# ipv6 route default <next_hop> [ <interface> ]
Router(config)# ip route <destination> <next_hop> [ <interface> ]
Router(config)# ipv6 route <destination> <next_hop> [ <interface> ]

仕様説明

デフォルトゲートウェイ設定

以下のようなコマンドでデフォルトゲートウェイをstaicに設定する事ができます。

Router(config)# ip route default <next_hop> [ <interface> ]
Router(config)# ipv6 route default <next_hop> [ <interface> ]

スタティックルート設定

スタティックルートの設定は以下コマンドを使用します。

Router(config)# ip route <destination> <next_hop> [ <interface> ]
Router(config)# ipv6 route <destination> <next_hop> [ <interface> ]

動作確認環境

以下の構成で動作確認を行います。

NEC IX スタティックルートの動作確認構成

 [R1:Cisco]
interface Ethernet0/0
 ip address 192.168.0.1 255.255.255.0
 ipv6 address 2001::1/64
 ipv6 address FE80::1 link-local
interface Loopback0
 ip address 10.1.1.1 255.255.255.255
 ipv6 address 2001:1::1/128
 ipv6 address FE80::1 link-local

 [R2:Cisco]
interface Ethernet0/0
 ip address 192.168.0.2 255.255.255.0
 ipv6 address 2001::2/64
 ipv6 address FE80::2 link-local
interface Loopback0
 ip address 10.2.2.2 255.255.255.255
 ipv6 address 2001:2::2/128
 ipv6 address FE80::2 link-local

 [R254:IX2215]
interface GigaEthernet1.0
  ip address 192.168.0.254/24
  ipv6 address 2001::254/64
  no shutdown

初期設定の全文は以下を参照下さい。

R1 config (Cisco 3640)
!

!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip icmp rate-limit unreachable
!
!
ip cef
no ip domain lookup
!
!
ipv6 unicast-routing
!
!
!
!
!
!
!
!
!
!
!
!
!
!
ip tcp synwait-time 5
!
!
!
interface Loopback0
 ip address 10.1.1.1 255.255.255.255
 ipv6 address 2001:1::1/128
 ipv6 address FE80::1 link-local
!
interface Ethernet0/0
 ip address 192.168.0.1 255.255.255.0
 half-duplex
 ipv6 address 2001::1/64
 ipv6 address FE80::1 link-local
!
!
no ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line vty 0 4
 login
!
!
end
R2 config (Cisco 3640)
!

!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip icmp rate-limit unreachable
!
!
ip cef
no ip domain lookup
!
!
ipv6 unicast-routing
!
!
!
!
!
!
!
!
!
!
!
!
!
!
ip tcp synwait-time 5
!
!
!
interface Loopback0
 ip address 10.2.2.2 255.255.255.255
 ipv6 address 2001:2::2/128
 ipv6 address FE80::2 link-local
!
interface Ethernet0/0
 ip address 192.168.0.2 255.255.255.0
 half-duplex
 ipv6 address 2001::2/64
 ipv6 address FE80::2 link-local
!
!
no ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line vty 0 4
 login
!
!
end
R254 config (IX2215)
! NEC Portable Internetwork Core Operating System Software
! IX Series IX2215 (magellan-sec) Software, Version 8.8.22, RELEASE SOFTWARE
! Compiled Jul 04-Wed-2012 13:57:25 JST #2
! Last updated Feb 02-Sun-2014 23:24:17 JST
!
!
hostname R254
timezone +09 00
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
device GigaEthernet0
!
device GigaEthernet1
!
device GigaEthernet2
!
device BRI0
  isdn switch-type hsd128k
!
device USB0
  shutdown
!
interface GigaEthernet0.0
  no ip address
  shutdown
!
interface GigaEthernet1.0
  ip address 192.168.0.254/24
  ipv6 address 2001::254/64
  no shutdown
!
interface GigaEthernet2.0
  no ip address
  shutdown
!
interface BRI0.0
  encapsulation ppp
  no auto-connect
  no ip address
  shutdown
!
interface USB-Serial0.0
  encapsulation ppp
  no auto-connect
  no ip address
  shutdown
!
interface Loopback0.0
  no ip address
!
interface Null0.0
  no ip address

スタティックルート

スタティックルート 設定投入

R254にstatic routeを投入し、R1, R2のloopback interfaceに疎通可能になるようにします。

 [R254:IX2215]
ip route 10.1.1.1/32 192.168.0.1
ip route 10.2.2.2/32 192.168.0.2
ipv6 route 2001:1::1/128 2001::1
ipv6 route 2001:2::2/128 2001::2

スタティックルート 設定確認

R254のstatic route設定を確認します。

 [R254:IX2215]
R254(config)# show ip route static
IP Routing Table - 2 entries, 3 hidden, 2043 frees
Entries: 0 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
S      10.1.1.1/32 [1/1] via 192.168.0.1, GigaEthernet1.0, 0:00:02
S      10.2.2.2/32 [1/1] via 192.168.0.2, GigaEthernet1.0, 0:00:02
R254(config)#
R254(config)# show ipv6 route static
IPv6 Routing Table - 2 entries, unlimited
Codes: C - Connected, L - Local, S - Static
       R - RIPng, O - OSPF, IA - OSPF inter area
       E1 - OSPF external type 1, E2 - OSPF external type 2, B - BGP
       s - Summary
Timers: Uptime/Age
S      2001:1::1/128 global [1/1]
         via 2001::1, GigaEthernet1.0, 0:00:06/0:00:00
S      2001:2::2/128 global [1/1]
         via 2001::2, GigaEthernet1.0, 0:00:06/0:00:00
R254(config)#

IPv4 疎通確認

R254からR1, R2のLoopback interfaceに対してIPv4の疎通が可能である事を確認します。

 [R254:IX2215]
R254(config)# ping 10.1.1.1
PING 192.168.0.254 > 10.1.1.1 56 data bytes
64 bytes from 10.1.1.1: icmp_seq=0 ttl=255 time=36.307 ms
64 bytes from 10.1.1.1: icmp_seq=1 ttl=255 time=5.731 ms
64 bytes from 10.1.1.1: icmp_seq=2 ttl=255 time=35.016 ms

--- 10.1.1.1 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip (ms)  min/avg/max = 5.731/25.684/36.307
R254(config)#
R254(config)#
R254(config)#
R254(config)# ping 10.2.2.2
PING 192.168.0.254 > 10.2.2.2 56 data bytes
64 bytes from 10.2.2.2: icmp_seq=0 ttl=255 time=53.485 ms
64 bytes from 10.2.2.2: icmp_seq=1 ttl=255 time=23.395 ms
64 bytes from 10.2.2.2: icmp_seq=2 ttl=255 time=32.395 ms

--- 10.2.2.2 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip (ms)  min/avg/max = 23.395/36.425/53.485
R254(config)#

IPv6 疎通確認

R254からR1, R2のLoopback interfaceに対してIPv4の疎通が可能である事を確認します。NEC IX2215はIPv6 pingをサポートしていないようなので、Ciscoルータ側から送信元I/Fを明示指定したpingによって疎通確認を行います。

 [R254:IX2215]
R254(config)# ping 2001:1::1
Looking up ipv4 address for "2001:1::1" ...Failed to open session
R254(config)#

 [R1:Cisco3640]
R1#ping 2001::254 source Loopback 0

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001::254, timeout is 2 seconds:
Packet sent with a source address of 2001:1::1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/14/36 ms
R1#

 [R2:Cisco3640]
R2#ping 2001::254 source Loopback 0

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001::254, timeout is 2 seconds:
Packet sent with a source address of 2001::2
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/12/24 ms
R2#
タイトルとURLをコピーしました