【實驗環境】
C3640-IK9O3S-M Version 12.4(10)
【實驗目的】
驗證BGP路由協議在MA網絡中下一跳屬性(Next-Hop)自動更改特例
【實驗拓撲】
【實驗描述】
BGP關系如圖,R1、R2、R3處在同一以太網中(134.0.0.0/24段),R2與R3為EBGP關系,R1與R2為IBGP關系,R1與R4使用串行鏈路建立EBGP關系
實驗觀察R3從R2收到的EBGP條目的下一跳屬性并分析原因
【實驗步驟】
1、R1基本配置,端口,EIGRP,與R2的IBGP,與R4的EBGP:
!
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface FastEthernet0/0
ip address 134.0.0.1 255.255.255.0
!
interface Serial1/0
ip address 14.0.0.1 255.255.255.0
clock rate 64000
!
router eigrp 1
network 1.1.1.1 0.0.0.0
network 134.0.0.0 0.0.0.255
no auto-summary
!
router bgp 1
no synchronization
bgp router-id 1.1.1.1
neighbor 2.2.2.2 remote-as 1
neighbor 2.2.2.2 update-source Loopback0
neighbor 2.2.2.2 next-hop-self
neighbor 14.0.0.2 remote-as 4
no auto-summary
!
2、R2基本配置,端口,EIGRP,與R1的IBGP,與R3的EBGP:
!
interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet0/0
ip address 134.0.0.2 255.255.255.0
!
router eigrp 1
network 2.2.2.2 0.0.0.0
network 134.0.0.0 0.0.0.255
no auto-summary
!
router bgp 1
no synchronization
bgp router-id 2.2.2.2
neighbor 1.1.1.1 remote-as 1
neighbor 1.1.1.1 update-source Loopback0
neighbor 1.1.1.1 next-hop-self
neighbor 134.0.0.3 remote-as 3
no auto-summary
!
3、R3基本配置,端口,與R2的EBGP:
!
interface Loopback0
ip address 3.3.3.3 255.255.255.0
!
interface FastEthernet0/0
ip address 134.0.0.3 255.255.255.0
!
router bgp 3
no synchronization
bgp router-id 3.3.3.3
network 3.3.3.0 mask 255.255.255.0
neighbor 134.0.0.2 remote-as 1
no auto-summary
!
4、R4基本配置,端口,與R1的EBGP:
!
interface Loopback0
ip address 4.4.4.4 255.255.255.0
!
interface Serial1/0
ip address 14.0.0.2 255.255.255.0
!
router bgp 4
no synchronization
bgp router-id 4.4.4.4
network 4.4.4.0 mask 255.255.255.0
neighbor 14.0.0.1 remote-as 1
no auto-summary
!
5、在R3上驗證與R4的連通性
R3#ping 4.4.4.4 so 3.3.3.3
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
Packet sent with a source address of 3.3.3.3
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 64/83/116 ms
6、在R3上查看BGP路由表
R3#sh ip bgp
BGP table version is 3, local router ID is 3.3.3.3
Network Next Hop Metric LocPrf Weight Path
*> 3.3.3.0/24 0.0.0.0 0 32768 i
*> 4.4.4.0/24 134.0.0.1 0 1 4 i
注意到4.4.4.0/24這一條路由是從R2上學來的,Next Hop屬性本應該為134.0.0.2的,現在卻變成了134.0.0.1
7、在R2上使用debug分析BGP路由更新
//開啟BGP更新調試
R2#debug ip bgp updates
BGP updates debugging is on for address family: IPv4 Unicast
//由于BGP為觸發更新,因此需要軟清除一下BGP路由表
R2#clear ip bgp * soft
*Mar 1 00:44:21.315: BGP(0): 1.1.1.1 send UPDATE (format) 3.3.3.0/24, next 2.2.2.2, metric 0, path 3
*Mar 1 00:44:21.319: BGP(0): 134.0.0.3 NEXT_HOP part 3 net 4.4.4.0/24, next 134.0.0.1
*Mar 1 00:44:21.319: BGP(0): 134.0.0.3 send UPDATE (format) 4.4.4.0/24, next 134.0.0.1, metric 0, path 4
從debug信息可以看到,R2在向R3發送的BGP路由更新中,下一跳屬性就已經是134.0.0.1了,再看R2的路由表:
R2#sh ip ro
1.0.0.0/32 is subnetted, 1 subnets
D 1.1.1.1 [90/156160] via 134.0.0.1, 00:37:02, FastEthernet0/0
2.0.0.0/32 is subnetted, 1 subnets
C 2.2.2.2 is directly connected, Loopback0
3.0.0.0/24 is subnetted, 1 subnets
B 3.3.3.0 [20/0] via 134.0.0.3, 00:18:57
4.0.0.0/24 is subnetted, 1 subnets
B 4.4.4.0 [200/0] via 1.1.1.1, 00:20:18
134.0.0.0/24 is subnetted, 1 subnets
C 134.0.0.0 is directly connected, FastEthernet0/0
這里就是BGP在MA網絡中的下一跳特例了,4.4.4.0/24網段的路由是通過1.1.1.1進行轉發的,而經過路由表的遞歸查詢,1.1.1.1又是經過134.0.0.1進行轉發的,而F0/0接口又與134.0.0.1在同一MA網絡,因此BGP就將下一跳屬性直接優化為路由更新源的地址了。
總結:如果收到BGP路由的下一跳與發出接口在同一MA網絡,將發出路由下一跳直接改為源下一跳。
上一篇 Access數據庫技術(41)