BGP配置中Weight选路的示例分析

今天就跟大家聊聊有关BGP配置中Weight选路的示例分析,可能很多人都不太了解,为了让大家更加了解,小编给大家总结了以下内容,希望大家根据这篇文章可以有所收获。

网站建设哪家好,找创新互联!专注于网页设计、网站建设、微信开发、成都微信小程序、集团企业网站建设等服务项目。为回馈新老客户创新互联还提供了平桥免费建站欢迎大家使用!

1、BGP公认必遵属性:as-path、next-hop、origin

origin: i表示IBGP通过network命令发布的路由

e表示EGP重发布进来的路由

?表示从IGP重分布或静态路由

2、BGP存在多跳最优路由时的选路依据

BGP配置中Weight选路的示例分析

3、Weight选路解析

属性
传播范围
默认值
优先值应用方向
备注
weight本路由器本路由器32768,其他路由器0大值优先INCISCO私有

BGP配置中Weight选路的示例分析

修改weight值的方法:

方法一:全部修改邻居传过来的路由的weight值,例如:

router bgp 4

 neighbor 1.1.1.1 weight 1

方法二:部分修改邻居传过来的路由的weight值,例如:

ip prefix-list 1 permit 33.33.33.0/24

route-map W permit 10

 match ip address prefix-list 1

 set weight 1

route-map W permit 20

router bgp 4

 neighbor 1.1.1.1 route-map W in

4、实验拓扑

BGP配置中Weight选路的示例分析5、基础配置

R1配置

interface Loopback0

 ip address 1.1.1.1 255.255.255.0

interface Serial0/0

 ip address 13.1.1.1 255.255.255.0

interface Serial0/1

 ip address 14.1.1.1 255.255.255.0

router ospf 110

 router-id 1.1.1.1

 log-adjacency-changes

 network 1.1.1.0 0.0.0.255 area 0

 network 14.1.1.0 0.0.0.255 area 0

router bgp 4

 no synchronization

 bgp router-id 1.1.1.1

 neighbor 4.4.4.4 remote-as 4

 neighbor 4.4.4.4 update-source Loopback0

 neighbor 4.4.4.4 next-hop-self

 neighbor 13.1.1.3 remote-as 3

 no auto-summary

R2配置

interface Loopback0

 ip address 2.2.2.2 255.255.255.0

interface Serial0/1

 ip address 23.1.1.2 255.255.255.0

interface FastEthernet1/0

 ip address 24.1.1.2 255.255.255.0

router ospf 110

 router-id 2.2.2.2

 network 2.2.2.0 0.0.0.255 area 0

 network 24.1.1.0 0.0.0.255 area 0

router bgp 4

 no synchronization

 bgp router-id 2.2.2.2

 neighbor 4.4.4.4 remote-as 4

 neighbor 4.4.4.4 update-source Loopback0

 neighbor 4.4.4.4 next-hop-self

 neighbor 23.1.1.3 remote-as 3

 no auto-summary

R3配置

interface Loopback0

 ip address 3.3.3.3 255.255.255.0

interface Loopback1

 ip address 33.33.33.33 255.255.255.0        

interface Serial0/0

 ip address 13.1.1.3 255.255.255.0

interface Serial0/1

 ip address 23.1.1.3 255.255.255.0router bgp 3

 no synchronization

 bgp router-id 3.3.3.3

 network 3.3.3.0 mask 255.255.255.0

 network 33.33.33.0 mask 255.255.255.0

 neighbor 13.1.1.1 remote-as 4

 neighbor 23.1.1.2 remote-as 4

 no auto-summary

R4配置

interface Loopback0

 ip address 4.4.4.4 255.255.255.0

interface Serial0/1

 ip address 14.1.1.4 255.255.255.0

interface FastEthernet1/0

 ip address 24.1.1.4 255.255.255.0

router ospf 110

 router-id 4.4.4.4

 network 4.4.4.0 0.0.0.255 area 0

 network 14.1.1.0 0.0.0.255 area 0

 network 24.1.1.0 0.0.0.255 area 0

router bgp 4

 no synchronization

 bgp router-id 4.4.4.4

 neighbor 1.1.1.1 remote-as 4

 neighbor 1.1.1.1 update-source Loopback0

 neighbor 2.2.2.2 remote-as 4

 neighbor 2.2.2.2 update-source Loopback0

 no auto-summary

6、默认选路

BGP配置中Weight选路的示例分析

根据BGP选路原则第八条可以知道,R4到达3.3.3.0/24、33.33.33.0/24都是经过R2。

BGP配置中Weight选路的示例分析

BGP配置中Weight选路的示例分析

7、全部修改邻居传过来的路由的weight值

由前面可以R4到达3.3.3.0/24、33.33.33.0/24都是经过R2,我们通过修改Weight值将R4到达3.3.3.0/24、33.33.33.0/24都是经过R1。

R4配置

router bgp 4

neighbor 1.1.1.1 weight 1

BGP配置中Weight选路的示例分析

8、部分修改邻居传过来的路由的weight值

R4到达3.3.3.0/24、33.33.33.0/24都是经过R2,我们通过修改Weight值将R4到达3.3.3.0/24经过R2、达到33.33.33.0/24都是经过R1。

R4配置

ip prefix-list 1 seq 5 permit 33.33.33.0/24

route-map W permit 10

 match ip address prefix-list 1

 set weight 1

route-map W permit 20

router bgp 4

 neighbor 1.1.1.1 route-map W in

BGP配置中Weight选路的示例分析

看完上述内容,你们对BGP配置中Weight选路的示例分析有进一步的了解吗?如果还想了解更多知识或者相关内容,请关注创新互联行业资讯频道,感谢大家的支持。


名称栏目:BGP配置中Weight选路的示例分析
本文路径:http://lszwz.com/article/psphii.html

其他资讯

售后响应及时

7×24小时客服热线

数据备份

更安全、更高效、更稳定

价格公道精准

项目经理精准报价不弄虚作假

合作无风险

重合同讲信誉,无效全额退款