配置BGP本地优先级 推荐
2010-01-25 11:30
429 查看
一、拓扑图:
二、配置基本的BGP。以R1为例:
[align=left]三、分析选择的下一跳:
1、查看一下R3和R4的路由表:[/align]
[align=left] [/align]
[align=left]2、查看一下R3和R4到130.130.1.1/24的BGP最佳路径:[/align]
[align=left] [/align]
[align=left] [/align]
[align=left]四、理论上来讲BGP选择了自己认为的最佳路径,但我们从图中拓扑可以看到:R4àR1是快速以太网都是为100M的链路。而R3通过的链路却要通过两条串口链路。如果串口链路的带宽比较小,那么这样的选择是不合理的。R3选择了一个次路由。比较R3和R4的BGP数据库。我们应该通过什么样的方式来改变R3的选择路径呢?首先我们要了解一个概念:BGP在选择最佳路由时,并不会考虑具体链路的带宽。从上图可以看到,显示的本地优先级都为100。根据这种判断,我们可以在本地配置本地优先级来确定数据流如何流出本自治系统。
1、把R4的优先级提高,因为BGP会优先选择本地优先级值较高的路由。[/align]
[align=left] [/align]
[align=left]2、clear ip bgp * soft 软涮新一下,再来看一下R3的路由表和BGP数据库:[/align]
五、下一跳自我:由EBGP学来的路由信息,在传递给IBGP邻居时,不改变其下一跳属性值 。(R1学习到的130.130.1.0这条路由传递给IBGP整个AS64513时不改变其下一跳属性,也就是都为192.168.2.2)
1、为了能够在R3上能看到路由变化,可以在R4上指定下一跳为自己,配置通告给R3的路由:
[align=left]2、再来看一下R3的路由表和拓扑数据:[/align]
六:终于完成了。前天配置的时候,本地优先级不能显示出来。很郁闷的是网上也找不到合适的显示本地优级资料。于是放下了,今天弄出来了。现在想想:可能是模拟器的问题。今天是同样的配置,然后到R3和R4上show 都能显示出来各自的本地优先级。要说明一下:只有两条或多条路径可选择的情况下才会显示出本地优先级。只有一条路径可选的话,不会显示出本地优先级。
二、配置基本的BGP。以R1为例:
R1(config)#router bgp 64512 R1(config-router)#net 172.16.1.0 mask 255.255.255.0 R1(config-router)#net 192.168.2.0 R1(config-router)#net 130.130.1.0 mask 255.255.255.0 R1(config-router)#nei 172.16.1.2 remote 64512 R1(config-router)#nei 192.168.2.1 remote 64513 |
1、查看一下R3和R4的路由表:[/align]
R3#sh ip route ……………… 172.16.0.0/24 is subnetted, 1 subnets B 172.16.1.0 [20/0] via 192.168.1.1, 00:02:55 10.0.0.0/24 is subnetted, 1 subnets C 10.1.1.0 is directly connected, Serial1/1 130.130.0.0/24 is subnetted, 1 subnets B 130.130.1.0 [20/0] via 192.168.1.1, 00:00:13 (R3到130.130.1.1通过192.168.1.1走) C 192.168.1.0/24 is directly connected, Serial1/0 B 192.168.2.0/24 [200/0] via 10.1.1.2, 00:02:59 R4#sh ip route ……………… 172.16.0.0/24 is subnetted, 1 subnets B 172.16.1.0 [20/0] via 192.168.2.2, 00:03:57 10.0.0.0/24 is subnetted, 1 subnets C 10.1.1.0 is directly connected, Serial1/0 130.130.0.0/24 is subnetted, 1 subnets B 130.130.1.0 [20/0] via 192.168.2.2, 00:00:56 (R4到130.130.1.0通过192.168.2.2走) B 192.168.1.0/24 [200/0] via 10.1.1.1, 00:03:57 C 192.168.2.0/24 is directly connected, FastEthernet0/0 |
[align=left]2、查看一下R3和R4到130.130.1.1/24的BGP最佳路径:[/align]
[align=left] [/align]
R3#sh ip bgp BGP table version is 9, local router ID is 192.168.1.2 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path * i10.1.1.0/24 10.1.1.2 0 100 0 i *> 0.0.0.0 0 32768 i *> 130.130.1.0/24 192.168.1.1 0 64512 i * i 192.168.2.2 0 100 0 64512 i * i172.16.1.0/24 192.168.2.2 0 100 0 64512 i *> 192.168.1.1 0 0 64512 i * 192.168.1.0 192.168.1.1 0 0 64512 i *> 0.0.0.0 0 32768 i *>i192.168.2.0 10.1.1.2 0 100 0 i * 192.168.1.1 0 64512 i R4#sh ip bgp Network Next Hop Metric LocPrf Weight Path *> 10.1.1.0/24 0.0.0.0 0 32768 i * i 10.1.1.1 0 100 0 i * i130.130.1.0/24 192.168.1.1 0 100 0 64512 i *> 192.168.2.2 0 0 64512 i * i172.16.1.0/24 192.168.1.1 0 100 0 64512 i *> 192.168.2.2 0 0 64512 i * 192.168.1.0 192.168.2.2 0 64512 i *>i 10.1.1.1 0 100 0 i *> 192.168.2.0 0.0.0.0 0 32768 i * 192.168.2.2 0 0 64512 i R4# |
[align=left]四、理论上来讲BGP选择了自己认为的最佳路径,但我们从图中拓扑可以看到:R4àR1是快速以太网都是为100M的链路。而R3通过的链路却要通过两条串口链路。如果串口链路的带宽比较小,那么这样的选择是不合理的。R3选择了一个次路由。比较R3和R4的BGP数据库。我们应该通过什么样的方式来改变R3的选择路径呢?首先我们要了解一个概念:BGP在选择最佳路由时,并不会考虑具体链路的带宽。从上图可以看到,显示的本地优先级都为100。根据这种判断,我们可以在本地配置本地优先级来确定数据流如何流出本自治系统。
1、把R4的优先级提高,因为BGP会优先选择本地优先级值较高的路由。[/align]
[align=left] [/align]
R4(config)#router bgp 64513 R4(config-router)#bgp default local-preference 150 (配置一个高出50的优先级) |
R3#sh ip route 172.16.0.0/24 is subnetted, 1 subnets B 172.16.1.0 [200/0] via 192.168.2.2, 00:01:09 10.0.0.0/24 is subnetted, 1 subnets C 10.1.1.0 is directly connected, Serial1/1 130.130.0.0/24 is subnetted, 1 subnets B 130.130.1.0 [200/0] via 192.168.2.2, 00:01:09 (现在下一跳变为:192.168.2.2) C 192.168.1.0/24 is directly connected, Serial1/0 B 192.168.2.0/24 [200/0] via 10.1.1.2, 00:58:57 R3#sh ip bgp Network Next Hop Metric LocPrf Weight Path * i10.1.1.0/24 10.1.1.2 0 150 0 i *> 0.0.0.0 0 32768 i * 130.130.1.0/24 192.168.1.1 0 64512 i *>i 192.168.2.2 0 150 0 64512 i (最佳路径为192.168.2.2) *>i172.16.1.0/24 192.168.2.2 0 150 0 64512 i * 192.168.1.1 0 0 64512 i * i192.168.1.0 192.168.2.2 0 150 0 64512 i * 192.168.1.1 0 0 64512 i *> 0.0.0.0 0 32768 i *>i192.168.2.0 10.1.1.2 0 150 0 i * 192.168.1.1 0 64512 i R3# |
1、为了能够在R3上能看到路由变化,可以在R4上指定下一跳为自己,配置通告给R3的路由:
R4(config)#router bgp 64513 R4(config-router)#nei 10.1.1.1 next-hop-self |
R3#sh ip route ……………… 172.16.0.0/24 is subnetted, 1 subnets B 172.16.1.0 [200/0] via 10.1.1.2, 00:01:32 10.0.0.0/24 is subnetted, 1 subnets C 10.1.1.0 is directly connected, Serial1/1 130.130.0.0/24 is subnetted, 1 subnets B 130.130.1.0 [200/0] via 10.1.1.2, 00:01:32 C 192.168.1.0/24 is directly connected, Serial1/0 B 192.168.2.0/24 [200/0] via 10.1.1.2, 01:47:43 R3#sh ip bgp Network Next Hop Metric LocPrf Weight Path * i10.1.1.0/24 10.1.1.2 0 150 0 i *> 0.0.0.0 0 32768 i * 130.130.1.0/24 192.168.1.1 0 64512 i *>i 10.1.1.2 0 150 0 64512 i *>i172.16.1.0/24 10.1.1.2 0 150 0 64512 i * 192.168.1.1 0 0 64512 i * i192.168.1.0 10.1.1.2 0 150 0 64512 i * 192.168.1.1 0 0 64512 i *> 0.0.0.0 0 32768 i *>i192.168.2.0 10.1.1.2 0 150 0 i * 192.168.1.1 0 64512 i |
相关文章推荐
- 使用route-map 配置BGP本地优先级
- Centos7.4配置本地yum源和阿里源并配置yum优先级
- 本地YUM源配置-Redhat Enterprise 5.9 推荐
- RedHat 5.4 Squid配置本地代理服务器 推荐
- 本地双网卡优先级配置
- CentOS 7.0本地yum源地址及 配置yum地址优先级
- win7配置host添加本地域名测试以及代理和host共存的解决方案 推荐
- 【实验9.11.4a】 配置IBGP和EBGP会话,本地优先级和MED属性【IEEEnjoy.L.ZH】
- CentOS配置本地yum源/阿里云yum源/163yuan源,并配置yum源的优先级
- BGP属性MED和本地优先级实验
- BGP(本地优先级)
- 【推荐】基于Apache在本地配置多个虚拟主机站点
- 01-01-BGP Aggregate-address address mask -----CISCO BGP4 命令与配置手册 推荐
- BGP有条件通告的配置和验证 推荐
- CentOS 7.0本地yum源地址及 配置yum地址优先级
- CentOS配置本地Yum源、阿里云Yum源、163Yum源、并配置Yum源的优先级
- 配置BGP权重 推荐
- linux学习:持续集成篇--Maven私有库和本地库的安装与配置-03 推荐
- (CCNP)BGP改变metric和本地优先级影响路径选择