※noteから引っ越してきた記事※
1) OSPF
初期設定
R7#sh run | s router ospf|router bgp
router ospf 100
redistribute bgp 100 subnets
network 155.1.79.0 0.0.0.255 area 0
router bgp 100
bgp log-neighbor-changes
redistribute ospf 100
neighbor 155.1.67.6 remote-as 100
iosv-6,9ではそれぞれBGPとOSPFでLoopbackを広告しており、iosv-7で互いに再配送している。
Before
R6#sh ip ro | b Gate
Gateway of last resort is not set
150.1.0.0/32 is subnetted, 2 subnets
C 150.1.6.6 is directly connected, Loopback0
B 150.1.9.9 [200/2] via 155.1.79.9, 00:03:30
155.1.0.0/16 is variably subnetted, 5 subnets, 2 masks
C 155.1.67.0/24 is directly connected, GigabitEthernet0/1
L 155.1.67.6/32 is directly connected, GigabitEthernet0/1
B 155.1.79.0/24 [200/0] via 155.1.67.7, 00:03:35
C 155.1.146.0/24 is directly connected, GigabitEthernet0/0
L 155.1.146.6/32 is directly connected, GigabitEthernet0/0
R9#sh ip ro | b Gate
Gateway of last resort is not set
150.1.0.0/32 is subnetted, 1 subnets
C 150.1.9.9 is directly connected, Loopback0
155.1.0.0/16 is variably subnetted, 4 subnets, 2 masks
C 155.1.9.0/24 is directly connected, GigabitEthernet0/1
L 155.1.9.9/32 is directly connected, GigabitEthernet0/1
C 155.1.79.0/24 is directly connected, GigabitEthernet0/0
L 155.1.79.9/32 is directly connected, GigabitEthernet0/0
OSPFから再配送されてきたiosv-9のLoopback(150.1.9.9/32)はiosv-6が学習しているが、iosv-6のLoopback(150.1.6.6/32)はiosv-9に届いていない。
bgp redistribute-internal
R7(config)#router bgp 100
R7(config-router)#bgp redistribute-internal
R7(config-router)#do clear ip bgp * soft
結果
R9#sh ip ro | b Gate
Gateway of last resort is not set
150.1.0.0/32 is subnetted, 2 subnets
O E2 150.1.6.6 [110/1] via 155.1.79.7, 00:01:43, GigabitEthernet0/0
C 150.1.9.9 is directly connected, Loopback0
155.1.0.0/16 is variably subnetted, 4 subnets, 2 masks
C 155.1.9.0/24 is directly connected, GigabitEthernet0/1
L 155.1.9.9/32 is directly connected, GigabitEthernet0/1
C 155.1.79.0/24 is directly connected, GigabitEthernet0/0
L 155.1.79.9/32 is directly connected, GigabitEthernet0/0
R9#ping 150.1.6.6 source lo0
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 150.1.6.6, timeout is 2 seconds:
Packet sent with a source address of 150.1.9.9
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 2/2/3 ms
学習できた、pingも通る。
2) EIGRP
初期設定
R7#sh run | s router eigrp|router bgp
router eigrp 100
network 155.1.79.0 0.0.0.255
redistribute bgp 100 metric 1000000 100 255 1 1500
router bgp 100
bgp log-neighbor-changes
bgp redistribute-internal
neighbor 155.1.67.6 remote-as 100
OSPFがEIGRPに変わっただけ。
Before
R6#sh ip ro | b Gate
Gateway of last resort is not set
150.1.0.0/32 is subnetted, 2 subnets
C 150.1.6.6 is directly connected, Loopback0
B 150.1.9.9 [200/130816] via 155.1.79.9, 00:00:11
155.1.0.0/16 is variably subnetted, 5 subnets, 2 masks
C 155.1.67.0/24 is directly connected, GigabitEthernet0/1
L 155.1.67.6/32 is directly connected, GigabitEthernet0/1
B 155.1.79.0/24 [200/0] via 155.1.67.7, 00:00:16
C 155.1.146.0/24 is directly connected, GigabitEthernet0/0
L 155.1.146.6/32 is directly connected, GigabitEthernet0/0
R9#sh ip ro | b Gate
Gateway of last resort is not set
150.1.0.0/32 is subnetted, 1 subnets
C 150.1.9.9 is directly connected, Loopback0
155.1.0.0/16 is variably subnetted, 4 subnets, 2 masks
C 155.1.9.0/24 is directly connected, GigabitEthernet0/1
L 155.1.9.9/32 is directly connected, GigabitEthernet0/1
C 155.1.79.0/24 is directly connected, GigabitEthernet0/0
L 155.1.79.9/32 is directly connected, GigabitEthernet0/0
OSPFの時と同様、BGPの経路がEIGRPへ再配送されていない。
bgp redistribute-internal&結果
R7(config)#router bgp 100
R7(config-router)#bgp redistribute-internal
R7(config-router)#do clear ip bgp * soft
R9#sh ip ro | b Gate
Gateway of last resort is not set
150.1.0.0/32 is subnetted, 2 subnets
D EX 150.1.6.6 [170/28416] via 155.1.79.7, 00:00:28, GigabitEthernet0/0
C 150.1.9.9 is directly connected, Loopback0
155.1.0.0/16 is variably subnetted, 4 subnets, 2 masks
C 155.1.9.0/24 is directly connected, GigabitEthernet0/1
L 155.1.9.9/32 is directly connected, GigabitEthernet0/1
C 155.1.79.0/24 is directly connected, GigabitEthernet0/0
L 155.1.79.9/32 is directly connected, GigabitEthernet0/0
R9#ping 150.1.6.6 source lo0
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 150.1.6.6, timeout is 2 seconds:
Packet sent with a source address of 150.1.9.9
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 2/2/3 ms
Dangerous
R7(config-router)#bgp ?
redistribute-internal Allow redistribution of iBGP into IGPs (dangerous)
ループする可能性が高くなるからね。