BGP:
當公司存在多出口鏈路,並且需要靈活的路由控制的
大規模網絡架構,一般採用 BGP。
dual-home:雙宿
多出口鏈路
工作過程:
1、建立鄰居表(IBGP鄰居)
show ip bgp summary
IBGP Peer
EBGP Peer
直連鄰居
非直連鄰居(指的是通過 loopback建立)
-更新源檢測機制
-直連檢測機制
去往對方的IP地址時,必須
使用直連路由。
%當 EBGP 報文的 TTL=1 的時候,
才進行直連檢測機制的檢查;
-解決方案:
neighor x.x.x.x ebgp-multihop
2、同步數據庫(BGP路由選路)
show ip bgp
#自己宣告進入到BGP的路由;
network
redistribute
#別人傳輸過來的BGP路由;
ibgp
ebgp
% > : best
&嘗試着將其放入路由表
&發送給自己的BGP鄰居路由器
show ip bgp neighbor x.x.x.x advertised-route
clear ip bgp * soft
3、創建路由表
show ip route bgp
內部路由AD:200
外部路由AD:20
本地路由AD:200
IBGP鄰居防環機制:
-IBGP水平分割
從IBGP鄰居收到的路由,不會再次發送給IBGP鄰居
解決方案:
1、全互聯(full-mesh)
2、聯盟(confedration)
#當BGP路由器存在聯盟時,運行的是小AS
#小AS內部發送的是小AS號;
#小AS之間發送的也應該是小AS號
但這些小AS號,必須在本地設備明確
指定爲 confedration peers as ;
並不是每個路由器上都得配置 peer as ,
僅需要在與其他小AS建立 ebgp 鄰居關係
的路由器上配置
#大AS之間發送的是大AS號;
3、路由反射器(route-reflector)
作爲路由器反射器的BGP路由器,會臨時
關閉“IBGP水平分割”功能。
對於路由器反射器(RR)而言,會有對應的
路由反射器客戶端(RR-Client):
RR會將RR-C傳過來的路由,反射給所有路由器;
RR會將非RR-C傳過來的路由,反射給自己的RR-C;
總而言之就是:
對於 RR 而言, 非RR-C與非RR-C之間不能傳,
其他的都可以傳輸(反射)
配置命令:
在路由器反射器上,指定任何一個內部鄰居
爲自己的客戶端,就可以:
router bgp XXX
neighbor x.x.x.x route-reflector-client
其他路由器不需要做任何的配置。
IBGP聯盟配置命令:
R1:
router bgp 1
no synchronization
no auto-summary
bgp router-id 1.1.1.1
bgp confederation identifier 123
bgp confederation peers 23
neighbor 10.10.2.2 remote-as 23
neighbor 10.10.2.2 ebgp-multihop 255
neighbor 10.10.2.2 update-source Loopback0
R2:
router bgp 23
no synchronization
no auto-summary
bgp router-id 2.2.2.2
bgp confederation identifier 123
bgp confederation peers 1
neighbor 10.10.1.1 remote-as 1
neighbor 10.10.1.1 ebgp-multihop 255
neighbor 10.10.1.1 update-source Loopback0
neighbor 10.10.3.3 remote-as 23
neighbor 10.10.3.3 update-source Loopback0
R3:( 沒有配置peere as )
router bgp 23
no synchronization
no auto-summary
bgp router-id 3.3.3.3
bgp confederation identifier 123
neighbor 10.10.2.2 remote-as 23
neighbor 10.10.2.2 update-source Loopback0
neighbor 10.10.2.2 next-hop-self
neighbor 192.168.34.4 remote-as 4
通過以上配置,可以確保 R1 可以正常接收到 R4 loopback 0
李軍
Tel:15135361516
qq:344728662
@[email protected]