BGP後門鏈路(Backdoor)實際案例(配圖+詳細驗證過程


Cisco提供一種方式強IGP路由優先於EBGP路由.這個概念也就是"後門鏈路"(backdoor link).EBGP路由可以標記爲後門鏈路,它將設置這些路由的管理距離與BGP本地或200相同.因爲這個管理距離要高於IGP,所以首選IGP路由.
 
以下是具體配置:
 
//// r1 ////
int lo0
  ip ad 1.1.1.1 255.255.255.0
 
int e1/0
  ip ad 192.1.1.1 255.255.255.0
 
router os 1
  network 0.0.0.0 255.255.255.255 a 0   //將所有接口宣告進OSPF
 
router bgp 200
  no syn  //關閉同步,同時也註定了全互連的拓撲
  neighbor 192.1.1.2 remote-as 200
  neighbor 192.1.1.2 update-source lo0  //以lo0接口IP作爲更新源地址
 
 
//// r2 ////
int lo0
  ip ad 2.2.2.2 255.255.255.0
 
int e1/0
  ip ad 192.1.1.2 255.255.255.0
 
int e0/0
  ip ad 193.1.1.2 255.255.255.0
 
int e2/0
  ip ad 195.1.1.2 255.255.255.0
 
router os 1
  network 0.0.0.0 255.255.255.255 a 0  //宣告所有接口進OSPF
 
router bgp 200
  no syn
  neighbor 192.1.1.1 remote-as 200
  neighbor 192.1.1.1 update-source lo0
  neighbor 192.1.1.1 next-hop-self
  neighbor 195.1.1.5 remote-as 100
  network 192.1.1.0 mask 255.255.255.0
 
 
//// r3 ////
int lo0
  ip ad 3.3.3.3 255.255.255.0
 
int e0/0
  ip ad 193.1.1.3 255.255.255.0
 
int e1/0
  ip ad 194.1.1.3 255.255.255.0
 
int e3/0
  ip ad 196.1.1.3 255.255.255.0
 
router os 1
  netw 0.0.0.0 255.255.255.255 a 0
 
router bgp 300
  no syn
  neighbor 196.1.1.5 remote-as 100
  neighbor 194.1.1.4 remote-as 300
  neighbor 194.1.1.4 update-source lo0
  neighbor 194.1.1.4 next-hop-self
  network 194.1.1.0 mask 255.255.255.0
 
 
//// r4 ////
int lo0
  ip ad 4.4.4.4 255.255.255.0
 
int e0/0
  ip ad 194.1.1.3 255.255.255.0
router os 1
  network 0.0.0.0 255.255.255.255 a 0
 
router bgp 300
  no syn
  neighbor 194.1.1.3 remote-as 300
  neighbor 194.1.1.3 update-source lo0
  network 192.1.1.0 mask 255.255.255.0 backdoor
 
//// r5 ////
int lo0
  ip ad 5.5.5.5 255.255.255.0
int e2/0
  ip ad 195.1.1.5 255.255.255.0
int e3/0
  ip ad 196.1.1.5 255.255.255.0
router bgp 100
  no syn
  neighbor 195.1.1.2 remote-as 200
  neighbor 196.1.1.3 remote-as 300
 
驗證:
//後門鏈路作用前
r2#sh ip bgp
   Network          Next Hop            Metric LocPrf Weight Path
*> 192.1.1.0        0.0.0.0                  0         32768 i
*> 194.1.1.0        195.1.1.5                              0 100 300 i
r2#
r2#
r2#
r2#sh ip ro bgp
B    194.1.1.0/24 [20/0] via 195.1.1.5, 00:00:49
 
r3#sh ip bgp
   Network          Next Hop            Metric LocPrf Weight Path
*> 192.1.1.0        196.1.1.5                              0 100 200 i
*> 194.1.1.0        0.0.0.0                  0         32768 i
r3#sh ip ro bgp
B    192.1.1.0/24 [20/0] via 196.1.1.5, 00:02:28
 
 
r3#sh ip ro             //後門鏈路作用前
     1.0.0.0/32 is subnetted, 1 subnets
O       1.1.1.1 [110/21] via 193.1.1.2, 00:04:22, Ethernet0/0
     2.0.0.0/32 is subnetted, 1 subnets
O       2.2.2.2 [110/11] via 193.1.1.2, 00:04:22, Ethernet0/0
     3.0.0.0/24 is subnetted, 1 subnets
C       3.3.3.0 is directly connected, Loopback0
     4.0.0.0/32 is subnetted, 1 subnets
O       4.4.4.4 [110/11] via 194.1.1.4, 00:04:22, Ethernet1/0
C    196.1.1.0/24 is directly connected, Serial3/0
C    193.1.1.0/24 is directly connected, Ethernet0/0
B    192.1.1.0/24 [20/0] via 196.1.1.5, 00:00:06
O    195.1.1.0/24 [110/74] via 193.1.1.2, 00:04:22, Ethernet0/0
C    194.1.1.0/24 is directly connected, Ethernet1/0
 
 
 
//後門鏈路作用後
r3#sh ip ro
     1.0.0.0/32 is subnetted, 1 subnets
O       1.1.1.1 [110/21] via 193.1.1.2, 00:06:38, Ethernet0/0
     2.0.0.0/32 is subnetted, 1 subnets
O       2.2.2.2 [110/11] via 193.1.1.2, 00:06:38, Ethernet0/0
     3.0.0.0/24 is subnetted, 1 subnets
C       3.3.3.0 is directly connected, Loopback0
     4.0.0.0/32 is subnetted, 1 subnets
O       4.4.4.4 [110/11] via 194.1.1.4, 00:06:38, Ethernet1/0
C    196.1.1.0/24 is directly connected, Serial3/0
C    193.1.1.0/24 is directly connected, Ethernet0/0
O    192.1.1.0/24 [110/20] via 193.1.1.2, 00:00:06, Ethernet0/0
O    195.1.1.0/24 [110/74] via 193.1.1.2, 00:06:38, Ethernet0/0
C    194.1.1.0/24 is directly connected, Ethernet1/0


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