1. 程式人生 > 實用技巧 >EBGP的第三方下一跳行為

EBGP的第三方下一跳行為

在多路訪問網路環境中,用直連線口建立鄰居關係,會產生第三方下一跳。
1.多路訪問網路(包括broadcast和NBMA)
2.字首是通過EBGP宣告的。

預設條件下,IBGP會話是不會改變字首的下一跳屬性的。對IBGP討論第三方下一跳是沒有意義的。
3.宣告字首的介面地址&neighbor指向的地址&該字首的下一跳地址,三個地址在同一網段

宣告字首的介面地址&neighbor後指向的地址在同一網段,意味著EBGP必須使用直連線口建立對等體關係,才會出現第三方下一跳行為。
結果:下一跳不會改變為那個宣告字首的地址,還是原來該字首的下一跳地址

有圖有真相:

image

RTA

interface FastEthernet0/0

ip address 10.10.10.1 255.255.255.0
duplex auto
speed auto
!
router bgp 100
no synchronization
bgp log-neighbor-changes
neighbor 10.10.10.2 remote-as 200
no auto-summary

RTC

interface FastEthernet0/0
ip address 10.10.10.2 255.255.255.0
duplex auto
speed auto
!
router ospf 10
log-adjacency-changes
network 10.10.10.2 0.0.0.0 area 0

!
router bgp 200
no synchronization
bgp log-neighbor-changes
network 11.11.11.0 mask 255.255.255.0
neighbor 10.10.10.1 remote-as 100
no auto-summary

RTB

interface Loopback0
ip address 11.11.11.11 255.255.255.0
ip ospf network point-to-point
!
interface FastEthernet0/0
ip address 10.10.10.3 255.255.255.0
duplex auto

speed auto
!
router ospf 10
log-adjacency-changes
network 10.10.10.3 0.0.0.0 area 0
network 11.11.11.11 0.0.0.0 area 0

RTA

show ip route

Gateway of last resort is not set

10.0.0.0/24 is subnetted, 1 subnets
C 10.10.10.0 is directly connected, FastEthernet0/0
11.0.0.0/24 is subnetted, 1 subnets
B 11.11.11.0 [20/2] via 10.10.10.3, 00:02:44

下一跳不是宣告字首的介面地址10.10.10.2,而是10.10.10.3

這樣,RTA到達11.11.11.0/24的路由就不需要經過RTC再到達RTB,是不是很智慧!

然而,智慧的第三方系一條有時候會產生問題

image

如果幀中繼網路的PVC是全互聯的,是沒有什麼問題的。

但是考慮到費用的原因,實際部署幀中繼的時候不可能全互聯的,大多數是採用hub-spoke模型。

如圖,RTC作為hub,RTA和RTC是spoke,EBGP第三方下一跳行為會讓RTA學到的11.11.11.0/24的路由下一跳是10.10.10.3,而RTA又沒有到達10.10.10.3的PVC時,

11.11.11.0/24是不可達的。

解決方法:

RTC:

router bgp 200

neighbor 10.10.10.2 next-hop-self

轉載於:https://blog.51cto.com/somejunbao/525589