将AR1上去往AR5环回口的流量由原先的次优路径AR1-AR2-AR4-AR5更改为AR1-AR3-AR5
1、AS100内为BGP联邦以此解决IBGP全互联的问题,AR2为BGP 2002,AR1与AR3为BGP 2001
2、AR4与AR5建立IBGP邻居关系,互相传递BGP路由以此达到AR1到AR5为双负载路径,为我们接下来进行路由调优创造条件
路由策略配置
ip community-filter 10 permit 55:55 /抓取对应团体属性的路由
route-policy comm permit node 10 /将抓取到的路由更改选路属性
if-match community-filter 10
apply preferred-value 100
#
route-policy comm permit node 20 /起个node 20自动匹配其他路由进行放行(node间或关系)
BGP配置
bgp 2001
router-id 1.1.1.1
confederation id 100 /配置联邦AS ID
confederation peer-as 2002 /联邦间起EBGP指定对等体子AS
peer 2.2.2.2 as-number 2002
peer 2.2.2.2 ebgp-max-hop 255
peer 2.2.2.2 connect-interface LoopBack0
peer 3.3.3.3 as-number 2001
#
ipv4-family unicast
undo synchronization
network 11.11.11.11 255.255.255.255
peer 2.2.2.2 enable
peer 3.3.3.3 enable
peer 3.3.3.3 route-policy comm import /在从IBGP对等体3.3.3.3引入路由时进行路由策略,控制层介入更改路由属性
bgp 2002
router-id 2.2.2.2
confederation id 100
confederation peer-as 2001
peer 1.1.1.1 as-number 2001
peer 1.1.1.1 ebgp-max-hop 255
peer 1.1.1.1 connect-interface LoopBack0
peer 24.0.0.4 as-number 200
#
ipv4-family unicast
undo synchronization
network 22.22.22.22 255.255.255.255
peer 1.1.1.1 enable
peer 1.1.1.1 next-hop-local /联盟间子AS在进行下一跳自我时无关子AS是否为EBGP邻居还是IBGP邻居
peer 24.0.0.4 enable
bgp 2001
router-id 3.3.3.3
confederation id 100
peer 1.1.1.1 as-number 2001
peer 1.1.1.1 connect-interface LoopBack0
peer 35.0.0.5 as-number 200
#
ipv4-family unicast
undo synchronization
network 33.33.33.33 255.255.255.255
peer 1.1.1.1 enable
peer 1.1.1.1 next-hop-local /联盟间子AS在进行下一跳自我时无关子AS是否为EBGP邻居还是IBGP邻居
peer 1.1.1.1 advertise-community /将路由传递给1.1.1.1时打上团体属性
peer 35.0.0.5 enable
bgp 200
peer 24.0.0.2 as-number 100
peer 45.0.0.5 as-number 200
#
ipv4-family unicast
undo synchronization
network 44.44.44.44 255.255.255.255
peer 24.0.0.2 enable
peer 45.0.0.5 enable
peer 45.0.0.5 next-hop-local
路由策略配置
route-policy comm permit node 10 /无需if-match匹配,所有应用此策略的路由都进行动作
apply community 55:55
#
route-policy comm permit node 20
BGP配置
bgp 200
peer 35.0.0.3 as-number 100
peer 45.0.0.4 as-number 200
#
ipv4-family unicast
undo synchronization
network 55.55.55.55 255.255.255.255 route-policy comm /调用路由策略,打团体属性
peer 35.0.0.3 enable
peer 35.0.0.3 advertise-community /传递路由时打上团体属性
peer 45.0.0.4 enable
peer 45.0.0.4 next-hop-local