BGP+mpls解決bgp黑洞配置 實驗學習筆記

在這裏插入圖片描述

首先配置ip接口環回口,r4在as4,r5在as5,r1,2,3在 AS10。as10內起ibgp用eigrp只宣告內網接口

在內網運行igp

r1:
router eigrp 90
no auto-summary 
eigrp router-id 1.1.1.1
network 12.1.1.1 0.0.0.0
network 13.1.1.1 0.0.0.0
netwrok 1.1.1.1 0.0.0.0
r2
rouer eigrp 90 
no auto-summary
eigrp router-id 2.2.2.2
network 2.2.2.2 0.0.0.0
network 12.1.1.2 0.0.0.0
r3
router eigrp 90 
no auto-summary 
eigrp router-id 3.3.3.3
network 13.1.1.3 0.0.0.0
network 3.3.3.3 0.0.0.0 

在r4, r2,r3 和r5上配置bgp

r4:
router bgp  4  //as號 
no auto-summary 
no synchronization
neighbor 24.1.1.2 remote-as 10  //默認自動建立ipv4的鄰居關係。
r2
router bgp 10
no auto-summary 
no synchronization
no bgp defalut ipv4-unicast //關閉默認
neighbor 24.1.1.4 remote-as 4
address-family ipv4 unicast 
neighbor 24.1.1.4 activate   // TBl ver傳遞變化 次數    

//跟r3建立 ibgp鄰居

router bgp 10
neighbor 3.3.3.3 remote-as 10
neighbor 3.3.3.3 update-source loopback 0 //修改更新源地址
 address-family ipv4 unicast 
 neighbor 3.3.3.3 activate

鄰居關係 :

  1. idle 針對鄰居查路由表的過程
  2. connect 嘗試建立tcp三次握手
  3. active 嘗試頻率更快
  4. open sent 發送
  5. open confirm 收到keepalive
  6. established 鄰接 cisco用空白顯示 prxrcd 0通過這個鄰居收到幾條路由。
    neighbor x.x.x.x ransport connection-mode passive
    被動
    //# neighbor x.x.x.x soft-reconfiguration inbound 排錯命令 開啓入向緩衝器 並記錄
    shwo bgp ipv4 unicast neighbor 5.5.5.5 received-routes
r3
router bgp 10 
no auto-summary 
no synchronization 
bgp router-id 3.3.3.3
no bgp default ipv4 unicast 
neighbor 2.2.2.2 remote-as 10
neighbor 2.2.2.2 update-source loopback 0
address-family ipv4 unicast 
neighbor 2.2.2.2 activate  // show bgp ipv4 unicast summary

在r3和r5之間建立ebgp鄰居,假設3跟5之間有多條鏈路連接,利用鏈路冗餘性來保證bgp鄰居關係的高可用性,使用環回口。但會有問題,沒有對端的環回口路由,ebgp報文ttl爲1.要解決。 路由問題寫靜態,

r3
ip route 5.5.5.0 255.255.255.0 s1/1 35.1.1.5
router bgp 10
neighbor 5.5.5.5 remote-as 5 
neighbor 5.5.5.5 update-source loopback 0
neighbor 5.5.5.5 ebgp-multihop //cr 255
address-family ipv4 unicast 
neighbor 5.5.5.5 activate 
r5
ip route 3.3.3.0 255.255.255.0 s1/0 35.1.1.3
router bgp 5
no auto-summary 
no synchronization
bgp router-id 5.5.5.5
neighbor 3.3.3.3 remote-as 10
neighbor 3.3.3.3 update-source loopback 0
neighbor 3.3.3.3 ebgp-multihop 

看傳路由

r4:
interface loopback 8
ip address 8.8.8.8 255.255.255.0
router bgp 4
network    8.8.8.0 mask 255.255.255.0              //主類路由通告會把mask隱藏掉
show bgp ipv4 unicast \
//其它方式重分發 ?

r5:int loo 9
ip address 9.9.9.9 255.255.255.0

do swho ipv4 unicast path起源屬性

  1. 通過network agreedate :i
  2. 通過ebgp 重分發進bgp就是:e
  3. 通過其它方式學習到的路由,通告進 bgp ?

*代表有資格 被加入路由表
s 不能加路由表 不能傳遞給其實鄰居
r沒有資格加路由表,能給其它鄰居

最優

ebgp
i ibgp

r3收到是下一跳是不可達的

在這裏插入圖片描述

r2
router	bgp 10
address-family ipv4 unicast 
neighbor 3.3.3.3 next-hop-self 
end
clear ip bgp * soft  //兩件事 對於入向 給鄰居重新發一次 入向:要求鄰居把他們能給我發的路由重新發一次

同樣9.9.9.9在傳到r2時也是一樣

ping 9.9.9.9 source 8.8.8.8能否ping 通

不能因爲他是沒有任何bgp路由的
所以可以啓用mpls

 R1
 ip cef
  mpls ip 
 mpls label protocol ldp 
 mpls ldp router-id loo0 force
 int range ehternet0/0-1
 mpls ip 
r2
ip cef 
  mpls ip 
mpls label protocol ldp 
mpls ldp router-id loo0 force
int ethernet0/1 
mpls ip 
r3
ip cef 
  mpls ip 
mpls label protocol ldp 
mpls ldp router-id loo0 force
int ethernet0/0
mpls ip 

bgp彙總 彙總會產生 明系也不會抑制 儘可能的提供選路空間
不把路由通告進bgp,通告彙總
r5兩條路由

1:r5上不通告兩條路由 寫靜態指向172.16.8.0/23 null 在network 會少一個原子聚合屬性,沒辦法判斷是彙總路由,影響後續選路

2.0

下放默認路由
neighbor x.x.x.x default-originate
沒辦法操控它的med屬性,屬性是有缺失的。

2。default-information originates
redistribute static

屬性:

公共屬性:
1.公認強制 支持 通告必須攜帶
AS path next-hop origin

2.公認自由 能識別,可以不攜帶

local preference

可選 廠商私有

可選傳遞

完整可傳遞
部分可傳遞 標記爲部分

可選非傳遞 med

as :20 10
從左到右 數據層面 流量經過20 最終10
從右到左 控制層面 來自10 經過20 到達 本地

有>纔有參選的資格

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