BGP-20190320-next-hop-self

BGP-20190320-next-hop-self

(1)本實驗主要論述了 BGP協議中、next-hop-self 的根本原因、如上圖 R3學習到R1 的1.1.1.1/32路由的下一跳是R1 的接口f0/0 的IP地址 12.1.1.1、爲什麼?

R3#sh ip bgp 
BGP table version is 4, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
* i1.1.1.1/32       12.1.1.1                 0    100      0 1 i
r>i2.2.2.2/32       23.1.1.2                 0    100      0 i
*> 3.3.3.3/32       0.0.0.0                  0         32768 i
R3#

(2)基本配置如下
R1配置:

interface Loopback1
 ip address 1.1.1.1 255.255.255.255
interface FastEthernet0/0
 ip address 12.1.1.1 255.255.255.0
 duplex auto
 speed auto

router bgp 1
 no synchronization
 bgp log-neighbor-changes
 network 1.1.1.1 mask 255.255.255.255
 neighbor 12.1.1.2 remote-as 234
 no auto-summary

R2配置:

interface Loopback2
 ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet0/0
 ip address 12.1.1.2 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 23.1.1.2 255.255.255.0
 duplex auto
 speed auto
!
router ospf 1
 log-adjacency-changes
 network 2.2.2.2 0.0.0.0 area 0
 network 23.1.1.2 0.0.0.0 area 0
!
router bgp 234
 no synchronization
 bgp log-neighbor-changes
 network 2.2.2.2 mask 255.255.255.255
 neighbor 12.1.1.1 remote-as 1
 neighbor 23.1.1.3 remote-as 234
 no auto-summary
!

R3配置:

interface Loopback3
 ip address 3.3.3.3 255.255.255.255
!
interface FastEthernet0/0
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 23.1.1.3 255.255.255.0
 duplex auto
 speed auto
!
router ospf 1
 log-adjacency-changes
 network 3.3.3.3 0.0.0.0 area 0
 network 23.1.1.3 0.0.0.0 area 0
!
router bgp 234
 no synchronization
 bgp log-neighbor-changes
 network 3.3.3.3 mask 255.255.255.255
 neighbor 23.1.1.2 remote-as 234
 no auto-summary
!

(3)配置next-hop-self之後效果:

R2(config)#router bgp 234
R2(config-router)#neighbor 23.1.1.3 next-hop-self 
R3#sh ip bgp 
BGP table version is 6, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*>i1.1.1.1/32       23.1.1.2                 0    100      0 1 i
r>i2.2.2.2/32       23.1.1.2                 0    100      0 i
*> 3.3.3.3/32       0.0.0.0                  0         32768 i
R3#

(4)原因分析:
記得我在講解BGP概述時候曾經跟學生講過、BGP這個EGP協議是工作在AS by AS之間的、BGP着眼的邊界是AS、那麼從這個角度來看我們應該把一個AS號內的設備邏輯當成是一臺
大的路由器、
BGP-20190320-next-hop-self

R1 看成是一臺大的路由器1 、R2和R3看成是一臺大的路由器2 、2收到1的路由、下一跳默認自然指向1的接口IP地址 12.1.1.1/24

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章