HCIE BGP選路實驗

2021-10-08 14:11:11 字數 2562 閱讀 8848

首先預配ip位址

內部igp

as間bgp建鄰

as1-as2走r1-r3,增大r2-r4的local-preference

字首列表

[r2]ip ip-prefix 12 permit 10.1.0.0 16 greater-equal 32

[r2]ip ip-prefix 12 permit 10.2.0.0 16 greater-equal 32

匹配字首列表

[r2]route-policy 12 permit node 10

[r2-route-policy]if-match ip-prefix 12

[r2]route-policy 12 permit node 20

呼叫[r2]bgp 1

[r2-bgp]peer 10.0.24.1 route-policy 12 import

as2-as1走r2-r4,增大r2-r4的med
[r3]ip ip-prefix 21 permit 10.4.0.0 16 greater-equal 32

[r3]ip ip-prefix 21 permit 10.3.0.0 16 greater-equal 32

[r3]route-policy 21 permit node 10

[r3-route-policy]if-match ip-prefix 21

[r3]route-policy 12 permit node 20

[r3]bgp 2

[r3-bgp]peer 10.0.13.1 route-policy 21 import

as1-as3走r2-r6,增加r2-r5的as-path
[r2]ip ip-prefix 13 permit 10.1.0.0 16 greater-equal 32

[r2]ip ip-prefix 13 permit 10.2.0.0 16 greater-equal 32

[r2]route-policy 13 permit node 10

[r2-route-policy]if-match ip-prefix 13

[r2]route-policy 13 permit node 20

[r2]bgp 1

[r2-bgp]peer 10.0.25.1 route-policy 13 import

as2-as3走r4-r6,修改r4-r6的起源屬性
[r4]ip ip-prefix 23 permit 10.5.0.0 16 greater-equal 32

[r4]ip ip-prefix 23 permit 10.6.0.0 16 greater-equal 32

[r4]ip ip-prefix 23 permit 10.7.0.0 16 greater-equal 32

[r4]route-policy 23 permit node 10

[r4-route-policy]if-match ip-prefix 23

[r4]route-policy 23 permit node 20

[r4]bgp 2

[r4-bgp]peer 10.0.46.1 route-policy 32 import

as3-as1走r5-r2,修改r6-r2的下一跳
[r6]ip ip-prefix 31 permit 10.5.0.0 16 greater-equal 16

[r6]ip ip-prefix 31 permit 10.6.0.0 16 greater-equal 16

[r6]ip ip-prefix 31 permit 10.7.0.0 16 greater-equal 16

[r6]route-policy 13 permit node 10

[r6-route-policy]if-match ip-prefix 31

[r6]route-policy 13 permit node 20

[r6]bgp 3

[r6-bgp]peer 10.0.26.2 route-policy 31 import

as3-as2走r6-r4,修改r5-r6prefval屬性
[r5]ip ip-prefix 32 permit 10.4.0.0 16 greater-equal 16

[r5]ip ip-prefix 32 permit 10.3.0.0 16 greater-equal 16

[r5]route-policy 32 permit node 10

[r5-route-policy]if-match ip-prefix 32

[r5]route-policy 32 permit node 20

[r5]bgp 3

[r5-bgp]peer 10.6.1.1 route-policy 32 import

BGP選路實驗

配置ip 這裡以r5為例 在as內部實現路由可達 這裡使用的是ospf同樣以r5為例 啟用bgp,並建立ebgp和ibgp鄰居 這裡一樣使用r5為例 檢視bgp路由表 檢視路由表 干涉選路 as1去as2 走r1 r3,通過增大local preference值,預設為100,在r2 r4的入向做 ...

BGP屬性選路實驗

先配置as400內的ospf,然後配置ibgp,用環迴介面建立,並且更新本地源位址,配置各as之間的ebgp,通告r1和r6的環迴位址進入bgp 基礎配置完成之後,因為as200那邊的rid更小,r1和r6的環迴之間來回選路都走as200,需要調整使其走as300 在r5上調整r1環迴bgp路由進入...

47 BGP配置實驗之MED選路

1 as path選路解析 屬性傳播範圍 預設值優先值 方向備註 weight 本路由器 本路由器32768,其他路由器0 大值優先 incisco私有 local preference as內部 100 邊界路由器,通告給ibgp鄰居,告知如何離開本as 大值優先 outas path as之間 ...