BGP synchronization済
経路はないけど学習する
iosv-4#sh ip bgp
BGP table version is 5, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
t secondary path,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 192.168.24.2 0 100 ?
*> 30.30.30.30/32 192.168.24.2 0 100 1 i
*> 192.168.12.0 192.168.24.2 0 100 ?
*> 192.168.30.0 192.168.24.2 0 100 ?
iosv-4#
iosv-4#sh ip ro | b Gate
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
B 1.1.1.1 [20/0] via 192.168.24.2, 00:06:06
4.0.0.0/32 is subnetted, 1 subnets
C 4.4.4.4 is directly connected, Loopback0
30.0.0.0/32 is subnetted, 1 subnets
B 30.30.30.30 [20/0] via 192.168.24.2, 00:06:06
B 192.168.12.0/24 [20/0] via 192.168.24.2, 00:06:06
192.168.24.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.24.0/24 is directly connected, GigabitEthernet0/0
L 192.168.24.4/32 is directly connected, GigabitEthernet0/0
B 192.168.30.0/24 [20/0] via 192.168.24.2, 00:06:06
iosv-3のlo0: 30.30.30.30/32はiosv-3のBGPプロセスのnetworkコマンドによって広告されている。
30.30.30.30/32はiosv-0へ広告され、その後iBGPピアのiosv-2へ、そしてiosv-4へと伝わっていく。
この時、iosv-0でBGP経路をIGP(今回はOSPF)への再配送を行っていないため、BGPプロセスを起動していないiosv-1では30.30.30.30/32の経路を学習しない。(下記)
iosv-1#sh ip ro | b Gate
Gateway of last resort is not set
2.0.0.0/32 is subnetted, 1 subnets
C 2.2.2.2 is directly connected, Loopback0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/2] via 192.168.23.3, 00:26:36, GigabitEthernet0/1
192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.12.0/24 is directly connected, GigabitEthernet0/0
L 192.168.12.2/32 is directly connected, GigabitEthernet0/0
192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.23.0/24 is directly connected, GigabitEthernet0/1
L 192.168.23.2/32 is directly connected, GigabitEthernet0/1
結果として、iosv-4は30.30.30.30/32を知っているのに到達できないことになる。(下記)
iosv-4#ping 30.30.30.30
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 30.30.30.30, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
synchronization
iosv-2(config-router)#synchronization
synchronizationを有効化すると、経路が確立しているルートのみeBGPに広告するようになる。
iosv-2#sh ip bgp
BGP table version is 1, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
t secondary path,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
* i 1.1.1.1/32 192.168.12.1 0 100 0 ?
* i 30.30.30.30/32 192.168.30.3 0 100 0 1 i
* i 192.168.12.0 192.168.12.1 0 100 0 ?
* i 192.168.30.0 192.168.12.1 0 100 0 ?
iosv-2#sh ip ro | b Gate
Gateway of last resort is not set
3.0.0.0/32 is subnetted, 1 subnets
C 3.3.3.3 is directly connected, Loopback0
O 192.168.12.0/24 [110/2] via 192.168.23.2, 00:36:29, GigabitEthernet0/0
192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.23.0/24 is directly connected, GigabitEthernet0/0
L 192.168.23.3/32 is directly connected, GigabitEthernet0/0
192.168.24.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.24.0/24 is directly connected, GigabitEthernet0/1
L 192.168.24.2/32 is directly connected, GigabitEthernet0/1
30.30.30.30/32は(iosv-0の他の経路もそうだけど)BGPテーブルには載っているが、ルーティングテーブルには記載がない。
そのため、bgp synchronizationの機能によりiosv-4へ30.30.30.30/32が広告されない。
iosv-4#sh ip bgp
iosv-4#sh ip bgp sum
BGP router identifier 4.4.4.4, local AS number 2
BGP table version is 9, main routing table version 9
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
192.168.24.2 4 100 11 11 9 0 0 00:06:53 0
iosv-4#sh ip ro | b Gate
Gateway of last resort is not set
4.0.0.0/32 is subnetted, 1 subnets
C 4.4.4.4 is directly connected, Loopback0
192.168.24.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.24.0/24 is directly connected, GigabitEthernet0/0
L 192.168.24.4/32 is directly connected, GigabitEthernet0/0
iosv-2とピアリングしているが、経路は一切受け取っていないことがわかる。
IGPに再配送して経路を確保する
iosv-0(config)#router ospf 1
iosv-0(config-router)#redistribute bgp 100 subnets
iosv-1#sh ip ro | b Gate
Gateway of last resort is not set
2.0.0.0/32 is subnetted, 1 subnets
C 2.2.2.2 is directly connected, Loopback0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/2] via 192.168.23.3, 00:42:07, GigabitEthernet0/1
30.0.0.0/32 is subnetted, 1 subnets
O E2 30.30.30.30 [110/1] via 192.168.12.1, 00:00:13, GigabitEthernet0/0
192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.12.0/24 is directly connected, GigabitEthernet0/0
L 192.168.12.2/32 is directly connected, GigabitEthernet0/0
192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.23.0/24 is directly connected, GigabitEthernet0/1
L 192.168.23.2/32 is directly connected, GigabitEthernet0/1
iosv-2#sh ip ro | b Gate
Gateway of last resort is not set
3.0.0.0/32 is subnetted, 1 subnets
C 3.3.3.3 is directly connected, Loopback0
30.0.0.0/32 is subnetted, 1 subnets
O E2 30.30.30.30 [110/1] via 192.168.23.2, 00:02:48, GigabitEthernet0/0
O 192.168.12.0/24 [110/2] via 192.168.23.2, 00:44:17, GigabitEthernet0/0
192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.23.0/24 is directly connected, GigabitEthernet0/0
L 192.168.23.3/32 is directly connected, GigabitEthernet0/0
192.168.24.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.24.0/24 is directly connected, GigabitEthernet0/1
L 192.168.24.2/32 is directly connected, GigabitEthernet0/1
iosv-4#sh ip ro | b Gate
Gateway of last resort is not set
4.0.0.0/32 is subnetted, 1 subnets
C 4.4.4.4 is directly connected, Loopback0
30.0.0.0/32 is subnetted, 1 subnets
B 30.30.30.30 [20/0] via 192.168.24.2, 00:23:56
192.168.24.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.24.0/24 is directly connected, GigabitEthernet0/0
L 192.168.24.4/32 is directly connected, GigabitEthernet0/0
iosv-0でBGPで受け取った30.30.30.30/32をOSPFへ再配送すると、iosv-1,2でも30.30.30.30/32を学習し、その結果iosv-4も30(ryの経路をルーティングテーブルに載せる。
参考
BGP - synchronization / no synchronization