实验原理:
BGP同步规则:BGP路由器不应使用通过IBGP获悉的路由或将其通告给外部邻居,除非该路由是本地的或通过IGP获悉的。
如果启用了同步,则路由器通过IBGP获悉路由后,将等待该路由传遍整个自治系统,然后再将其通告给外部对等体。这样,自治系统内的所有路由器都将同步,能够路由这样的数据流,即当前自治系统向其他自治系统指出它能够路由的数据流。BGP同步规则还确保了整个自治系统中信息的一致性,从而避免自治系统中出现路由黑洞
禁用同步后,可以减少路由器通过IGP传输的路由,并提高BGP的汇聚速度,因为路由器获悉路由后就可以通告它
如果在自治系统中的路由器没有采用全互联IBGP,则应启用同步。
实验拓扑:
实验配置:
R1#show run
router eigrp 1
network 16.16.16.0 0.0.0.255
network 172.1.1.0 0.0.0.255
no auto-summary
!
router bgp 65100
no synchronization
bgp router-id 1.1.1.1
bgp log-neighbor-changes
network 172.1.1.0 mask 255.255.255.0
neighbor 26.26.26.2 remote-as 65100
no auto-summary
R6#show running-config
router eigrp 1
network 16.16.16.0 0.0.0.255
network 26.26.26.0 0.0.0.255
no auto-summary
R2#show running-config
router eigrp 1
network 26.26.26.0 0.0.0.255
no auto-summary
!
router bgp 65100
synchronization
bgp router-id 2.2.2.2
bgp log-neighbor-changes
neighbor 16.16.16.1 remote-as 65100
neighbor 23.23.23.3 remote-as 65103
no auto-summary
R3#show running-config
router bgp 65103
no synchronization
bgp router-id 3.3.3.3
bgp log-neighbor-changes
neighbor 23.23.23.2 remote-as 65100
no auto-summary
R3#show running-config
router bgp 65103
no synchronization
bgp router-id 3.3.3.3
bgp log-neighbor-changes
neighbor 23.23.23.2 remote-as 65100
no auto-summary
实验验证:
基本配置完成后在R1上宣告172.1.1.0/24网络,在R1,R2,R3上都能学到该网络。
R2#sh ip route
16.0.0.0/24 is subnetted, 1 subnets
D 16.16.16.0 [90/2681856] via 26.26.26.6, 00:24:31, Serial0/2
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback0
23.0.0.0/24 is subnetted, 1 subnets
C 23.23.23.0 is directly connected, Serial0/1
172.1.0.0/24 is subnetted, 1 subnets
B 172.1.1.0 [200/0] via 16.16.16.1, 00:01:23
26.0.0.0/24 is subnetted, 1 subnets
C 26.26.26.0 is directly connected, Serial0/2
R3#show ip route
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
23.0.0.0/24 is subnetted, 1 subnets
C 23.23.23.0 is directly connected, Serial0/1
172.1.0.0/24 is subnetted, 1 subnets
B 172.1.1.0 [20/0] via 23.23.23.2, 00:01:53
在R2 上开启同步后在R2,R3上看不到172.1.1.0/24网络
R2#show ip route
16.0.0.0/24 is subnetted, 1 subnets
D 16.16.16.0 [90/2681856] via 26.26.26.6, 00:26:41, Serial0/2
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback0
23.0.0.0/24 is subnetted, 1 subnets
C 23.23.23.0 is directly connected, Serial0/1
26.0.0.0/24 is subnetted, 1 subnets
C 26.26.26.0 is directly connected, Serial0/2
R3#show ip route
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
23.0.0.0/24 is subnetted, 1 subnets
C 23.23.23.0 is directly connected, Serial0/1
当在R1上在EIGRP进程下宣告172.1.1.0/24网络后,在R2,R3上重新出现该路由
R2#show ip route
172.1.0.0/24 is subnetted, 1 subnets
D 172.1.1.0 [90/2809856] via 26.26.26.6, 00:00:03, Serial0/2
R3#show ip route
172.1.0.0/24 is subnetted, 1 subnets
B 172.1.1.0 [20/0] via 23.23.23.2, 00:00:43
R2#sh ip bgp rib-failure
Network Next Hop RIB-failure RIB-NH Matches
172.1.1.0/24 16.16.16.1 Higher admin distance n/a