再帰検索とアドレス包含

図のようなアドレッシングでR1に次のスタティックがある場合

 

R1#sh ip route | b Gate
Gateway of last resort is not set

      172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C        172.16.13.0/24 is directly connected, FastEthernet1/0
L        172.16.13.1/32 is directly connected, FastEthernet1/0
S     192.168.0.0/17 [1/0] via 172.16.13.3
      192.168.100.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.100.0/24 is directly connected, FastEthernet0/0
L        192.168.100.1/32 is directly connected, FastEthernet0/0
S     192.168.200.0/24 [1/0] via 192.168.100.2

 

R1のfa0/0を落としても192.168.200.0/24のNH(192.168.100.2)が解決できるのでstaticは消えない。また、debugを見るとupdatingとある。

R1#debug ip routing
IP routing debugging is on
R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#int fa0/0
R1(config-if)#shut
R1(config-if)#
*May  4 14:00:41.987: is_up: FastEthernet0/0 0 state: 6 sub state: 1 line: 1
*May  4 14:00:41.991: RT: interface FastEthernet0/0 removed from routing table
*May  4 14:00:41.991: RT: del 192.168.100.0 via 0.0.0.0, connected metric [0/0]
*May  4 14:00:41.995: RT: delete subnet route to 192.168.100.0/24
*May  4 14:00:41.999: RT: del 192.168.100.1 via 0.0.0.0, connected metric [0/0]
*May  4 14:00:41.999: RT: delete subnet route to 192.168.100.1/32
*May  4 14:00:42.055: RT: updating static 192.168.200.0/24 (0x0)  :
    via 192.168.100.2

R1(config-if)#
*May  4 14:00:43.967: %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to administratively down
R1(config-if)#
*May  4 14:00:43.971: is_up: FastEthernet0/0 0 state: 6 sub state: 1 line: 1
*May  4 14:00:44.967: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to down
R1(config-if)#
*May  4 14:00:44.983: is_up: FastEthernet0/0 0 state: 6 sub state: 1 line: 1
R1(config-if)#
R1(config-if)#do sh ip route | b Gate
Gateway of last resort is not set

      172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C        172.16.13.0/24 is directly connected, FastEthernet1/0
L        172.16.13.1/32 is directly connected, FastEthernet1/0
S     192.168.0.0/17 [1/0] via 172.16.13.3
S     192.168.200.0/24 [1/0] via 192.168.100.2
R1(config-if)#

 

一度戻す。

R1(config-if)#no shut
R1(config-if)#
*May  4 14:03:36.283: is_up: FastEthernet0/0 0 state: 4 sub state: 1 line: 1
R1(config-if)#
*May  4 14:03:38.247: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
R1(config-if)#
*May  4 14:03:38.251: is_up: FastEthernet0/0 0 state: 4 sub state: 1 line: 1
*May  4 14:03:39.247: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
*May  4 14:03:39.251: is_up: FastEthernet0/0 1 state: 4 sub state: 1 line: 1
*May  4 14:03:39.255: RT: updating connected 192.168.100.0/24 (0x0)  :
    via 0.0.0.0 Fa0/0

*May  4 14:03:39.259: RT: add 192.168.100.0/24 via 0.0.0.0, connected metric [0/0]
*May  4 14:03:39.263: RT: interface FastEthernet0/0 added to routing table
*May  4 14:03:39.263: RT: updating connected 192.168.100.1/32 (0x0)  :
    via 0.0.0.0 Fa0/0

*May  4 14:03:39.267: RT: network 192.168.100.0/24 is now subnetted
*May  4 14:03:39.271: RT: network 192.168.100.0 is now variably masked
*May  4 14:03:39.271: RT: add 192.168.100.1/32 via 0.0.0.0, connected metric [0/0]
*May  4 14:03:39.307: RT:
R1(config-if)#updating static 192.168.200.0/24 (0x0)  :
    via 192.168.100.2

R1(config-if)#

 

ここでstaticを修正してみる。宛先NWである192.168.200.0/24とNHの192.168.100.2を包含するstaticに変更。

R1(config-if)#do sh run | inc ip route
ip route 192.168.0.0 255.255.128.0 172.16.13.3
ip route 192.168.200.0 255.255.255.0 192.168.100.2
R1(config-if)#no ip route 192.168.0.0 255.255.128.0 172.16.13.3
R1(config)#
R1(config)#ip route 192.168.0.0 255.255.0.0 172.16.13.3
R1(config)#
R1(config)#do sh ip route | b Gate
Gateway of last resort is not set

      172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C        172.16.13.0/24 is directly connected, FastEthernet1/0
L        172.16.13.1/32 is directly connected, FastEthernet1/0
S     192.168.0.0/16 [1/0] via 172.16.13.3
      192.168.100.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.100.0/24 is directly connected, FastEthernet0/0
L        192.168.100.1/32 is directly connected, FastEthernet0/0
S     192.168.200.0/24 [1/0] via 192.168.100.2
R1(config)#

 

再度、fa0/0を落とす。

R1(config)#int fa0/0
R1(config-if)#shut
R1(config-if)#
*May  4 14:08:24.063: is_up: FastEthernet0/0 0 state: 6 sub state: 1 line: 1
*May  4 14:08:24.063: RT: interface FastEthernet0/0 removed from routing table
*May  4 14:08:24.063: RT: del 192.168.100.0 via 0.0.0.0, connected metric [0/0]
*May  4 14:08:24.067: RT: delete subnet route to 192.168.100.0/24
*May  4 14:08:24.071: RT: del 192.168.100.1 via 0.0.0.0, connected metric [0/0]
*May  4 14:08:24.075: RT: delete subnet route to 192.168.100.1/32
*May  4 14:08:24.127: RT: del 192.168.200.0 via 192.168.100.2, static metric [1/0]
*May  4 14:08:24.131: RT: delete network route to 192.168.200.0/24
R1(config-if)#
*May  4 14:08:26.043: %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to administratively down
R1(config-if)#
*May  4 14:08:26.047: is_up: FastEthernet0/0 0 state: 6 sub state: 1 line: 1
*May  4 14:08:27.043: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to down
R1(config-if)#
*May  4 14:08:27.051: is_up: FastEthernet0/0 0 state: 6 sub state: 1 line: 1
R1(config-if)#
R1(config-if)#do sh ip route | b Gate
Gateway of last resort is not set

      172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C        172.16.13.0/24 is directly connected, FastEthernet1/0
L        172.16.13.1/32 is directly connected, FastEthernet1/0
S     192.168.0.0/16 [1/0] via 172.16.13.3
R1(config-if)#

 

NHを解決できると言う点では変わらないはずが、今回はstaticが消えている。

コメント