45、BGP配置实验之Localpreference选路-创新互联

1、Local preference选路解析

创新互联建站服务项目包括丰顺网站建设、丰顺网站制作、丰顺网页制作以及丰顺网络营销策划等。多年来,我们专注于互联网行业,利用自身积累的技术优势、行业经验、深度合作伙伴关系等,向广大中小型企业、政府机构等提供互联网行业的解决方案,丰顺网站推广取得了明显的社会效益与经济效益。目前,我们服务的客户以成都为中心已经辐射到丰顺省份的部分城市,未来相信会继续扩大服务区域并继续获得客户的支持与信任!
属性
传播范围
默认值
优先值方向
备注
weight本路由器本路由器32768,其他路由器0大值优先INCISCO私有

Local preferenceAS内部100:边界路由器,通告给IBGP邻居,告知如何离开本AS大值优先OUT

45、BGP配置实验之Local preference选路

修改Local preference值的方法:

方法一:全部修改通告给IBGP邻居的路由的Local preference值,例如:

router bgp 4

 bgp default local-preference 125

方法二:部分修改通告给IBGP邻居的路由的Local preference值,例如:

2、实验拓扑

45、BGP配置实验之Local preference选路3、基础配置

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

4、默认选路

45、BGP配置实验之Local preference选路根据BGP选路原则第八条可以知道,R4到达3.3.3.0/24、33.33.33.0/24都是经过R2。

45、BGP配置实验之Local preference选路

45、BGP配置实验之Local preference选路

5、全部修改通告给IBGP邻居的路由的Local preference值

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

R4配置

router bgp 4

 bgp default local-preference 125

45、BGP配置实验之Local preference选路

6、部分修改通告给IBGP邻居的路由的Local preference值

R4到达3.3.3.0/24、33.33.33.0/24都是经过R2,我们通过修改Local preference值将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

no cdp log mismatch duplex

route-map L permit 10

 match ip address prefix-list 1

 set local-preference 125

route-map L permit 20

router bgp 4

 neighbor 4.4.4.4 route-map L out

45、BGP配置实验之Local preference选路

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。

分享文章:45、BGP配置实验之Localpreference选路-创新互联
浏览路径:https://www.cdcxhl.com/article10/dcshgo.html

成都网站建设公司_创新互联,为您提供品牌网站制作外贸网站建设服务器托管网站维护营销型网站建设企业网站制作

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

商城网站建设