close

這篇是解釋BGP的next-hop-self功能。

請見拓樸與設定:

1-1.png

請注意紅字,下一張圖是設定「neighbor 3.3.3.3 next-hop-self」前的結果,

1-2.png

你可以看見R3帶來源3.3.3.3去ping R1的1.1.1.1不通,並且是去包就不可達、而非回包不可達;R3帶來源3.3.3.3是因為有在BGP 23下「network 3.3.3.3 mask 255.255.255.255」。

R1有3.3.3.3的路由,但是在R3的路由表不但沒有1.1.1.1的路,而且在「show ip bgp」的輸出,R3認為網路1.1.1.1 / 32的下一站是12.0.0.1,然而R3路由表也沒有12.0.0.1。

那麼請看設定「neighbor 3.3.3.3 next-hop-self」後的結果,

1-3.png

在R2下neighbor 3.3.3.3 next-hop-self後並且bgp軟清(註解),意義是如果R2將路由送給R3,那麼R3要將封包繞送到這些網路的下一站是我(R2)。

你可以看見R3路由表安裝了1.1.1.1 / 32的路由往2.2.2.2,而且在「show ip bgp」的輸出,R3認為網路1.1.1.1 / 32的下一站是2.2.2.2(R2),這才是正確的。

所以R3帶來源3.3.3.3去ping R1的1.1.1.1就會通,這便是BGP next-hop-self的用途。

註解:bgp軟清使用在如果策略路由改變,但是不會重新建立bgp鄰居關係的情形;而bgp硬清則會重新建立bgp鄰居關係。


It is explain for BGP next-hop-self function.
[The topology and configuration]
Please notice red word, next image is before set 「neighbor 3.3.3.3 next-hop-self」.

You can see ping 1.1.1.1 source 3.3.3.3 on R3, it is unreachable. And forth unreachable for that.
Source address carry 3.3.3.3, becasue 「network 3.3.3.3 mask 255.255.255.255」 under the BGP 23.
R1 has route of 3.3.3.3, however R3 has not only without route of 1.1.1.1, but also see output with 「show ip bgp」.
R3 thinks network 1.1.1.1 / 32 next-hop is 12.0.0.1, but it's route table hasn't 12.0.0.1.

Next image is after set 「neighbor 3.3.3.3 next-hop-self」.


Commands 「neighbor 3.3.3.3 next-hop-self」 and 「clear ip bgp * soft」to soft reset(mark) on R2. Mean is R2 tells R3 your next-hop is me(R2) if R2 sends routes to R3.
You can see install that route of 1.1.1.1 / 32 forward to 2.2.2.2 on R3. And output of 「show ip bgp」, R3 thinks network 1.1.1.1 / 32 next-hop is 2.2.2.2(R2). It is correct.
So ping 1.1.1.1(R1) source 3.3.3.3 on R3 , it is reachable. And it is 「BGP next-hop-self」 usage.
mark:Use 「clear ip bgp * soft」to soft reset if policy routing changed, and doesn't reestablish bgp neighbor;
Use 「clear ip bgp *」 to hard reset will reestablish bgp neighbor.

arrow
arrow
    全站熱搜

    Chin 發表在 痞客邦 留言(0) 人氣()