BGP选路原则之AS_Path属性(bgp路由中as-path作用)

网友投稿 789 2022-09-18


BGP选路原则之AS_Path属性(bgp路由中as-path作用)

AS_Path选路属性实验 ● AS_Path属性描述这条路由所途径的BGP自制系统(即路过了哪些AS),越短越优!

拓扑:

要求:使用AS_Path方式,在AR4上修改AR5传递过来的192.168.1.0/24路由条目,让AR4去往192.168.1.0/24的网络走AR6路由上、而非直连路由器AR5上。

AR1配置:

interface GigabitEthernet0/0/0 ip address 12.0.0.1 255.255.255.0 interface GigabitEthernet0/0/1 ip address 16.0.0.1 255.255.255.0

bgp 1 peer 12.0.0.2 as-number 234 peer 16.0.0.6 as-number 6

ipv4-family unicast undo synchronization peer 12.0.0.2 enable peer 16.0.0.6 enable

AR2配置:

interface GigabitEthernet0/0/0 ip address 23.0.0.2 255.255.255.0 interface GigabitEthernet0/0/1 ip address 12.0.0.2 255.255.255.0 interface LoopBack0 ip address 2.2.2.2 255.255.255.255

bgp 234 peer 4.4.4.4 as-number 234 peer 4.4.4.4 connect-interface LoopBack0 peer 12.0.0.1 as-number 1 # ipv4-family unicast undo synchronization peer 4.4.4.4 enable peer 4.4.4.4 next-hop-local peer 12.0.0.1 enable

ospf 1 router-id 2.2.2.2 area 0.0.0.0 network 2.2.2.2 0.0.0.0 network 23.0.0.2 0.0.0.0

AR3配置:

interface GigabitEthernet0/0/0 ip address 23.0.0.3 255.255.255.0 interface GigabitEthernet0/0/1 ip address 34.0.0.3 255.255.255.0 interface LoopBack0 ip address 3.3.3.3 255.255.255.255

ospf 1 router-id 3.3.3.3 area 0.0.0.0 network 3.3.3.3 0.0.0.0 network 23.0.0.3 0.0.0.0 network 34.0.0.3 0.0.0.0

ip route-static 0.0.0.0 0.0.0.0 23.0.0.2

AR4配置:

interface GigabitEthernet0/0/0 ip address 34.0.0.4 255.255.255.0 interface GigabitEthernet0/0/1 ip address 45.0.0.4 255.255.255.0 interface LoopBack0 ip address 4.4.4.4 255.255.255.255

bgp 234 peer 2.2.2.2 as-number 234 peer 2.2.2.2 connect-interface LoopBack0 peer 45.0.0.5 as-number 5

ipv4-family unicast undo synchronization import-route ospf 1 peer 2.2.2.2 enable peer 2.2.2.2 next-hop-local peer 45.0.0.5 enable peer 45.0.0.5 route-policy as5_import import

ospf 1 router-id 4.4.4.4 area 0.0.0.0 network 4.4.4.4 0.0.0.0 network 34.0.0.4 0.0.0.0

route-policy as5_import permit node 10 if-match ip-prefix 192.168.1.0 apply as-path 100 200 300 additive //在原有AS路径上,增加新AS,将新AS添加到原有AS左侧

route-policy as5_import permit node 20

ip ip-prefix 192.168.1.0 index 10 permit 192.168.1.0 24

AR5配置:

interface GigabitEthernet0/0/0 ip address 45.0.0.5 255.255.255.0 interface GigabitEthernet0/0/1 ip address 192.168.1.1 255.255.255.0

bgp 5 peer 45.0.0.4 as-number 234 # ipv4-family unicast undo synchronization network 192.168.1.0 peer 45.0.0.4 enable

ip route-static 192.168.1.0 255.255.255.0 NULL0

AR6配置:

interface GigabitEthernet0/0/0 ip address 16.0.0.6 255.255.255.0 interface LoopBack1 ip address 192.168.1.1 255.255.255.0

bgp 6 peer 16.0.0.1 as-number 1 # ipv4-family unicast undo synchronization network 192.168.1.0 peer 16.0.0.1 enable

ip route-static 192.168.1.0 255.255.255.0 NULL0


版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:一文学会配置IP-Link与双机热备联动(双机热备ip设置)
下一篇:SpringBoot使用H2嵌入式数据库的实例代码
相关文章

 发表评论

暂时没有评论,来抢沙发吧~