BGP進階學習之RR設計不合理致使的路由環路

 RR的設計建議有一下幾點:html

1.       不要跨越非客戶端創建客戶端網絡

2.       不要跨越客戶端創建非客戶端對等體ide

3.       客戶端與非客戶端之間不要創建IBGP會話oop

下面的實驗說明了第一個設計建議:跨越非客戶端創建客戶端形成的路由環路。測試

拓撲以下:this

 

R1處於AS100,其他全部路由器在AS200中。spa

AS2內部運行OSPF,各路由器將直連網段發佈進ospf設計

R5R7之間沒有對等體關係,R6R8之間沒有對等體關係,R7R8之間沒有對等體關係。orm

R5R8之間跨越R7創建客戶端對等體關係。router

R6R7之間跨越R8創建客戶端對等體關係。

 

實線表示物理鏈接,虛線表示對等體鏈接。

基本配置以下:

R1發佈10.1.1.0/24網段進BGPR7,R8分別發佈70.1.1.0/24,80.1.1.0/24網段進BGP已完成測試。

R1

R1#sh ip int b

Interface                  IP-Address      OK? Method Status                Protocol

FastEthernet0/0            unassigned      YES manual up                    up     

FastEthernet0/0.13         13.1.1.1        YES manual up                    up     

FastEthernet0/0.14         14.1.1.1        YES manual up                    up     

Loopback0                  10.1.1.1        YES manual up                    up 

   

R1#sh run | b router

router bgp 100

 no synchronization

 bgp router-id 1.1.1.1

 bgp log-neighbor-changes

 network 10.1.1.0 mask 255.255.255.0

 neighbor 13.1.1.3 remote-as 200

 neighbor 14.1.1.4 remote-as 200

 no auto-summary

R3

R3#sh ip int b

Interface                  IP-Address      OK? Method Status                Protocol

FastEthernet0/0            unassigned      YES manual up                    up     

FastEthernet0/0.13         13.1.1.3        YES manual up                    up     

FastEthernet0/0.35         35.1.1.3        YES manual up                    up     

Loopback0                  30.1.1.1        YES manual up                    up     

R3#sh run | b router

router ospf 10

 router-id 3.3.3.3

 log-adjacency-changes

 network 35.1.1.0 0.0.0.255 area 0

!

router bgp 200

 no synchronization

 bgp router-id 3.3.3.3

 bgp log-neighbor-changes

 network 30.1.1.0 mask 255.255.255.0

 neighbor 13.1.1.1 remote-as 100

 neighbor 35.1.1.5 remote-as 200

 neighbor 35.1.1.5 next-hop-self

 no auto-summary

R4

R4#sh ip int b

Interface                  IP-Address      OK? Method Status                Protocol

FastEthernet0/0            unassigned      YES manual up                    up      

FastEthernet0/0.14         14.1.1.4        YES manual up                    up          

FastEthernet0/0.46         46.1.1.4        YES manual up                    up       

R4#sh run | b router

router ospf 10

 router-id 4.4.4.4

 log-adjacency-changes

 network 46.1.1.0 0.0.0.255 area 0

!

router bgp 200

 no synchronization

 bgp router-id 4.4.4.4

 bgp log-neighbor-changes

 neighbor 14.1.1.1 remote-as 100

 neighbor 46.1.1.6 remote-as 200

 neighbor 46.1.1.6 next-hop-self

 no auto-summary

 

R5

R5#sh ip int b

Interface                  IP-Address      OK? Method Status                Protocol

FastEthernet0/0            unassigned      YES manual up                    up     

FastEthernet0/0.35         35.1.1.5        YES manual up                    up     

FastEthernet0/0.57         57.1.1.5        YES manual up                    up     

 

R5#sh run | b router

router ospf 10

 router-id 5.5.5.5

 log-adjacency-changes

 network 35.1.1.0 0.0.0.255 area 0

 network 57.1.1.0 0.0.0.255 area 0

!

router bgp 200

 no synchronization

 bgp router-id 5.5.5.5

 bgp log-neighbor-changes

 neighbor 35.1.1.3 remote-as 200

 neighbor 35.1.1.3 route-reflector-client

 neighbor 68.1.1.6 remote-as 200

 neighbor 78.1.1.8 remote-as 200

 neighbor 78.1.1.8 route-reflector-client

 no auto-summary

 

R6

R6#sh ip int b

Interface                  IP-Address      OK? Method Status                Protocol

FastEthernet0/0            unassigned      YES manual up                    up     

FastEthernet0/0.46         46.1.1.6        YES manual up                    up     

FastEthernet0/0.68         68.1.1.6        YES manual up                    up        

R6#sh run | b router

router ospf 10

 router-id 6.6.6.6

 log-adjacency-changes

 network 46.1.1.0 0.0.0.255 area 0

 network 68.1.1.0 0.0.0.255 area 0

!

router bgp 200

 no synchronization

 bgp router-id 6.6.6.6

 bgp log-neighbor-changes

 neighbor 46.1.1.4 remote-as 200

 neighbor 46.1.1.4 route-reflector-client

 neighbor 57.1.1.5 remote-as 200

 neighbor 78.1.1.7 remote-as 200

 neighbor 78.1.1.7 route-reflector-client

 no auto-summary

 

R7

R7#sh ip int b

Interface                  IP-Address      OK? Method Status                Protocol

FastEthernet0/0            unassigned      YES manual up                    up     

FastEthernet0/0.57         57.1.1.7        YES manual up                    up     

FastEthernet0/0.78         78.1.1.7        YES manual up                    up        

Loopback0                  70.1.1.1        YES manual up                    up     

R7#sh run | b router

router ospf 10

 router-id 7.7.7.7

 log-adjacency-changes

 network 57.1.1.0 0.0.0.255 area 0

 network 78.1.1.0 0.0.0.255 area 0

!

router bgp 200

 no synchronization

 bgp router-id 7.7.7.7

 bgp log-neighbor-changes

 network 70.1.1.0 mask 255.255.255.0

 neighbor 68.1.1.6 remote-as 200

 no auto-summary

 

R8

R8#sh ip int b

Interface                  IP-Address      OK? Method Status                Protocol

FastEthernet0/0            unassigned      YES manual up                    up     

FastEthernet0/0.68         68.1.1.8        YES manual up                    up     

FastEthernet0/0.78         78.1.1.8        YES manual up                    up     

Loopback0                  80.1.1.1        YES manual up                    up     

R8#sh run | b router

router ospf 10

 router-id 8.8.8.8

 log-adjacency-changes

 network 68.1.1.0 0.0.0.255 area 0

 network 78.1.1.0 0.0.0.255 area 0

!

router bgp 200

 no synchronization

 bgp router-id 8.8.8.8

 bgp log-neighbor-changes

 network 80.1.1.0 mask 255.255.255.0

 neighbor 57.1.1.5 remote-as 200

 no auto-summary

 

網絡配置完成後查看鄰居創建是否正常,IGP是否收斂。

 

分析:

1.       R1R3R4發送10.1.1.0/24前綴

2.       R3,R4收到,修改下一跳後向本身的RR發送

3.       這裏分析R5的狀況。R5收到後會有一個路徑決策過程,這裏R6也會向它發送10.1.1.0/24的前綴,根據BGP路徑決策的13個原則,R5最總選擇IGP度量值最小的,即選擇R3做爲下一跳。而後它將這個最佳路徑發往R6R8

4.       同理,R6最總選擇的下一跳是R4

5.       關鍵在於R7R8。由於R7只能收到R6發來的更新,因此,它去往10.1.1.0/24的下一跳也是R4;同理R8去往10.1.1.0/24的下一跳是R3

6.       這時要關注IGP了。見下文show輸出。

 

R7#sh ip b 10.1.1.0

BGP routing table entry for 10.1.1.0/24, version 14

Paths: (1 available, best #1, table Default-IP-Routing-Table)

  Not advertised to any peer

  100

    46.1.1.4 (metric 3) from 68.1.1.6 (6.6.6.6)

      Origin IGP, metric 0, localpref 100, valid, internal, best

      Originator: 4.4.4.4, Cluster list: 6.6.6.6

R7#sh ip rou 46.1.1.0

Routing entry for 46.1.1.0/24

  Known via "ospf 10", distance 110, metric 3, type intra area

  Last update from 78.1.1.8 on FastEthernet0/0.78, 00:54:26 ago

  Routing Descriptor Blocks:

  * 78.1.1.8, from 4.4.4.4, 00:54:26 ago, via FastEthernet0/0.78

      Route metric is 3, traffic share count is 1

 

R7去往10.1.1.0/24的下一跳是46.1.1.4,R4;去往46.1.1.4的下一跳是R8。(這個不難理解)

 

下面看看R8的路徑輸出

R8#sh ip b 10.1.1.0

BGP routing table entry for 10.1.1.0/24, version 12

Paths: (1 available, best #1, table Default-IP-Routing-Table)

  Not advertised to any peer

  100

    35.1.1.3 (metric 3) from 57.1.1.5 (5.5.5.5)

      Origin IGP, metric 0, localpref 100, valid, internal, best

      Originator: 3.3.3.3, Cluster list: 5.5.5.5

R8#sh ip rou 35.1.1.0

Routing entry for 35.1.1.0/24

  Known via "ospf 10", distance 110, metric 3, type intra area

  Last update from 78.1.1.7 on FastEthernet0/0.78, 00:56:28 ago

  Routing Descriptor Blocks:

  * 78.1.1.7, from 3.3.3.3, 00:56:28 ago, via FastEthernet0/0.78

      Route metric is 3, traffic share count is 1

 

R8去往10.1.1.0/24的下一跳是35.1.1.3,R3,去往35.1.1.3的下一跳是R7

好,到這裏環路出現了!R7去往10.1.1.0/24網段的數據包發給了R8R8把去往10.1.1.0/24的數據又發給了R7,數據包就在R7R8之間來回倒騰,直到TTL超時。

下面用TRACEROOT命令能夠比較直觀的看出來數據是怎麼倒來倒去的。

 

R8#traceroute

Protocol [ip]:

Target IP address: 10.1.1.1

Source address: 80.1.1.1

Numeric display [n]: 10

Timeout in seconds [3]:

Probe count [3]:

Minimum Time to Live [1]:

Maximum Time to Live [30]: 10

Port Number [33434]:

Loose, Strict, Record, Timestamp, Verbose[none]:

Type escape sequence to abort.

Tracing the route to 10.1.1.1

 

  1 78.1.1.7 32 msec 40 msec 64 msec

  2 78.1.1.8 72 msec 48 msec 60 msec

  3 78.1.1.7 56 msec 48 msec 80 msec

  4 78.1.1.8 108 msec 88 msec 80 msec

  5 78.1.1.7 88 msec 112 msec 140 msec

  6 78.1.1.8 108 msec 92 msec 152 msec

  7 78.1.1.7 136 msec 152 msec 176 msec

  8 78.1.1.8 140 msec 136 msec 132 msec

  9 78.1.1.7 172 msec 156 msec 196 msec

10 78.1.1.8 196 msec 168 msec 184 msec

相關文章
相關標籤/搜索