複製鏈接
請複製以下鏈接發送給好友

BGP4+

鎖定
為了使BGP4能夠支持多種網絡層協議,如IPv6和IPX等,規定了一種BGP4多協議擴展即BGP4+來實現BGP4對IPv6協議的支持。
外文名
BGP4+
用    途
支持網絡層協議

BGP4+簡介

為了使BGP4能夠支持多種網絡層協議,如IPv6和IPX等,規定了一種BGP4多協議擴展即BGP4+來實現BGP4對IPv6協議的支持。

BGP4+擴展

1 1
為了使其他網絡層協議也可以使用BGP-4,必須添加多協議NLRI及其下一跳信息。RFC 2858擴展了BGP,使之支持多個網絡層協議。IPv6就是一個受支持的協議。為了適應多協議支持的新需求,BGP4+添加了兩個新屬性:多協議可達NLRI(MP-REACH-NLRI)
多協議不可達NLRI(MP-UNREACH-NLRI)

BGP4+屬性

多協議可達NLRI(MP-REACH-NLRI)描述了到達目的地的信息。該屬性包含的信息有:
地址屬於哪個網絡層協議
到目的前綴的下一跳地址
每個MP-REACH-NLRI更新報文包含一個下一跳地址和一些相關的NLRI。NLRI都以<length/prefix>形式表示,其中length是前綴的長度,prefix是可達性IPv6地址前綴
如圖所示,R3和R4是EBGP鄰居,R2和R3也是EBGP鄰居,這三個路由器共享一個以太網鏈路。R1和R2是IBGP鄰居。 該屬性允許鄰居路由器撤銷IPv6路由,它包含了鄰居應該從其RIB中刪除的IPv6前綴列表。
MP_UNREACH_NLRI屬性的字段介紹如下:
Address Family Identifier(地址族標識符,2字節)
2 2
Subsequent Address Family Identifier(併發的地址族標識符,1字節)Withdrawn Routes(撤銷的路由)

BGP4+配置步驟

步驟1、啓動BGP4+
啓動BGP4+配置實例R1的配置:
ZXR10_R1(config)#router bgp 100
ZXR10_R1(config-router)#bgp router-id 1.1.1.1
3 3
ZXR10_R1(config-router)#neighbor 2005::2 remote-as 200 ZXR10_R1(config-router)#address-family ipv6
ZXR10_R1(config-router-af)#neighbor 2005::2 activate
ZXR10_R1(config-router-af)#network 2001::/64
R2的配置:
ZXR10_R2(config)#router bgp 200
ZXR10_R2(config-router)#bgp router-id 2.2.2.2
ZXR10_R2(config-router)#neighbor 2005::1 remote-as 100
ZXR10_R2(config-router)#address-family ipv6
ZXR10_R2(config-router-af)#neighbor 2005::1 activate
ZXR10_R2(config-router-af)#network 2003::/64
步驟2、配置BGP4+路由通告
在建立好BGP4+鄰居後,可以使用以下辦法通告BGP4+路由:
用network命令通告路由
用redistribute命令將別的路由協議學習到的路由再分配到BGP4+中
步驟3、配置EBGP多跳
如圖所示,路由器R1需要與路由器R2上地址為2003::2/64的非直連接口建立鄰居關係。
R1的配置(其他配置省略): ZXR10_R1(config)#router bgp 100
4 4
ZXR10_R1(config-router)#neighbor 2003::2 remote-as 300ZXR10_R1(config-router)#neighbor 2003::2 ebgp-multihop
R2的配置(其他配置省略):
ZXR10_R2(config)#router bgp 300
ZXR10_R2(config-router)#neighbor 2005::1 remote-as 100
步驟4、配置BGP4+路由反射器
步驟
命令
功能
1
ZXR10(config-router-af)#neighbor {<ipv6-address> | <peer-group-name>} route-reflector-client
將鄰居設置為路由反射器客户
2
ZXR10(config-router)#bgp client-to-clientreflection
設置客户端到客户端的反射
3
ZXR10(config-router)#bgp cluster-id {<value> | <ip-address>}
設置路由反射器的羣ID
BGP4+路由反射器配置實例
如圖所示,AS100中有兩個路由反射器:R3和R4。其中R4的客户端為R5和R6,R3的客户端為R1和R2。
R3的配置: ZXR10_R3(config)#router bgp 100
5 5
ZXR10_R3 (config-router)#address-family ipv6ZXR10_R3 (config-router-af)#neighbor 3ffe::1 activate
ZXR10_R3 (config-router-af)#neighbor 3ffe::2 activate
ZXR10_R3 (config-router-af)#neighbor 3ffe::1 route-reflector-client //設置路由反射器客户
ZXR10_R3 (config-router-af)#neighbor 3ffe::2 route-reflector-client //設置路由反射器客户
R2的配置:
ZXR10_R2(config)#router bgp 100
ZXR10_R2(config-router)#address-family ipv6
ZXR10_R2(config-router-af)#neighbor 3ffe::3 activate
步驟5、配置BGP聯盟
步驟
命令
功能
1
ZXR10(config-router)#bgp confederation identifier <value>
設置聯盟ID
2
ZXR10(config-router)#bgp confederation peers<as-number> [<as-number>]
設置聯盟對等端AS號
BGP聯盟配置實例
如圖所示,AS200中有5台BGP4+路由器,我們將其劃分成兩個子AS,一個定義為AS65010,包含路由器R3,R5,R6;另一個定義為AS65020,包含路由器R4,R7。
6 6
R3的配置:R3(config)#router bgp 65010R3(config-router)#bgp confederation identifier 200 //設置聯盟ID
R3(config-router)#bgp confederation peers 65020 //設置聯盟對等端AS號
R5的配置:
R5(config)#router bgp 65010
R5(config-router)#bgp confederation identifier 200 //設置聯盟ID
步驟6、配置BGP路由屬性
命令
功能
ZXR10(config-router)#bgp always-compare-med
允許對不同自治系統中各鄰居路徑的多出口鑑別器(MED)進行比較
ZXR10(config-router)#bgp default local-preference <value>
設置BGP4+的默認本地優先權值
ZXR10(config-router)#neighbor {<ipv6-address> | <peer-group-name>} advertisement-interval <interval>
設置向鄰居傳播路由變化的最小時間間隔
ZXR10(config-router)#neighbor {<ipv6-address> | <peer-group-name>} description <line>
設置鄰居的描述
ZXR10(config-router)#neighbor {<ipv6-address> | <peer-group-name>} passive
設置不發送更新信息給鄰居
ZXR10(config-router)#neighbor <ipv6-address>peer-group [<group-name>]
創建一個對等組,並設置鄰居屬於該對等組
ZXR10(config-router)#neighbor {<ipv6-address> | <peer-group-name>} shut-down
使鄰居處於管理關閉狀態
ZXR10(config-router)#neighbor {<ipv6-address> | <peer-group-name>} timers <keepalive> <holdtime>
設置鄰居的相關定時器
ZXR10(config-router)#neighbor {<ipv6-address> | <peer-group-name>} update-source {loopback<interface number>| supervlan <interfacenumber> | vlan <interface number>}
設置與鄰居建立TCP連接的源地址
步驟7、配置BGP4+的IPv6地址族
命令
功能
ZXR10(config-router)# address-family ipv6
進入IPv6地址族模式
ZXR10(config-router-af)#neighbor {<ipv6-address> | <peer-group-name>} default-originate
向指定鄰居發送缺省路由::/0
ZXR10(config-router-af)#neighbor {<ipv6-address> | <peer-group-name>} maximum-prefix <value>
設置可以從鄰居接收的最大路由數目
ZXR10(config-router-af)#neighbor {<ipv6-address> | <peer-group-name>} next-hop-self
強制使用自身作為通告路由的下一跳,一般用於NBMA網絡上
ZXR10(config-router-af)#neighbor {<ipv6-address> | <peer-group-name>} remove-private-as
將通告給鄰居的路由中的私有AS過濾掉
ZXR10(config-router-af)#neighbor {<ipv6-address> | <peer-group-name>} send-community
在向鄰居通告路由時發送團體屬性
ZXR10(config-router-af)#neighbor {<ipv6-address> | <peer-group-name>} soft-reconfiguration
設置鄰居支持軟重置

BGP4+配置實例

如圖所示,R4和R1建立EBGP,R1和R2建立IBGP,R2和R5建立多跳EBGP。其中,假設R4中存在圖中右上角標註的四條靜態路由。在R4的配置中,僅通告聚合網段2004::/16。R2與R5之間通過R3建立EBGP多跳關係。 R4的配置:
R4(config)#router bgp 2
R4(config-router)#neighbor 2001::1 remote-as 1
7 7
R4(config-router)#address-family ipv6R4(config-router-af)#neighbor 2001::1 activate
R4(config-router-af)#redistribute static
R4(config-router-af)#aggregate-address 2004::/16 as-set summary-only //僅通告聚合網段
R1的配置:
R1(config)#router bgp 1
R1(config-router)#neighbor 2003::2 remote-as 1
R1(config-router)#neighbor 2001::4 remote-as 2
R1(config-router)#address-family ipv6
R1(config-router-af)#neighbor 2001::4 activate
R1(config-router-af)#neighbor 2003::2 activate
R1(config-router-af)#neighbor 2003::2 next-hop-self
R2的配置:
R2(config)#router bgp 1
R2(config-router)#neighbor 2003::1 remote-as 1
R2(config-router)#neighbor 2007::5 remote-as 3
R2(config-router)#neighbor 2007::5 ebgp-multihop //配置EBGP多跳
R2(config-router)#address-family ipv6
R2(config-router-af)#neighbor 2003::1 activate
R2(config-router-af)#neighbor 2007::5 activate
R2(config-router-af)#neighbor 2003::1 next-hop-self
R5的配置:
R5(config)#router bgp 3
R5(config-router)#neighbor 2005::2 remote-as 1
R5(config-router)#neighbor 2005::2 ebgp-multihop //配置EBGP多跳
R5(config-router)#address-family ipv6
R5(config-router-af)#neighbor 2005::2 activate

BGP4+維護與診斷

當遇到BGP4+路由問題時,我們可以通過相關的調試命令來幫助定位故障,排除錯誤。其中用的最多的是show命令,通過show命令可以查看當前BGP4+鄰居狀態,路由器學習到的BGP4+路由信息等。
命令
功能
ZXR10# show bgp all protocol
顯示BGP4+協議模塊的配置信息
ZXR10#show bgp ipv6 unicast neighbor
查看BGP4+鄰接關係,顯示當前鄰居狀態
ZXR10#show bgp ipv6 unicast
顯示BGP4+路由選擇表中的條目
ZXR10#show bgp ipv6 unicast summary
顯示所有BGP4+鄰居連接的狀態
ZXR10#show bgp all protocol
BGP router ID is 2.2.2.2, Local as is 1
Hold time is 90 seconds, KeepAlive time is 30 seconds
Default local preference is 100
Default export metric is 0
IGP synchronization is enabled
Default information advertise is disabled
Always compare med is disabled
Fast fallover is enabled
Client-to-client reflection is enabled
Ipv4 unicast is activated
Router target is filtered
Route dampening is disabled
Distance : external 20 internal 200
ZXR10#show bgp ipv6 unicast neighbor
BGP neighbor is 2005::1, remote AS 1, internal link
BGP version 4, remote router ID 1.1.1.1
BGP state = Established, up for 00:08:04
Last read update 00:02:31, hold time is 90 seconds, keepalive interval
is 30 seconds
Neighbor capabilities:
Route refresh: advertised and received
Address family IPv6 Unicast: advertised and received
ZXR10#show bgp ipv6 unicast
Status codes: *valid, >best, i-internal
Origin codes: i-IGP, e-EGP, ?-incomplete
n
Network Next Hop Metric LocPrf Path
*>i2001::/64 2005::1 100 i
*>i2001::1/128 2005::1 100 i
*>2003::/64 :: i
*>2003::2/128 :: i
*>2005::/64 ::
*i2005::/64 2005::1 100
*>i2005::1/128 2005::1 100
*>2005::2/128 ::
ZXR10#show bgp ipv6 unicast summary
Neighbor Ver As MsgRcvd MsgSend Up/Down(s) State/PfxRcd
2005::1 4 1 25 25 00:12:04 4
除show命令外,我們還可以使用debug命令觀察BGP4+鄰接建立過程、路由更新過程等。
命令
功能
ZXR10# debug ip bgp in
跟蹤顯示BGP接收的notification報文,並列出錯誤號和子錯誤號
ZXR10#debug ip bgp out
跟蹤顯示BGP發出的notification報文,並列出錯誤號和子錯誤號
ZXR10#debug ip bgp events
跟蹤顯示BGP連接的狀態機遷移