實驗原理:
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