取消
显示结果 
搜索替代 
您的意思是: 
cancel
1930
查看次数
20
有帮助
1
评论
碧云天
Spotlight
Spotlight
本帖最后由 碧云天 于 2020-3-24 21:35 编辑
一.测试拓扑
212610d5j2oklo448z3lz4.png
测试总结:

  • 设置weight只能在邻居的入方式设置
  • local-preference修改可以向IBGP邻居传递
  • 修改as-path属性只对EBGP邻居有效,对IBGP邻居无效
  • 在入口方向和出口方向修改AS-PATH,增加AS的顺序不一样
  • MED可以用于让对方选路
  • 精确选路优先使用local-preference和MED属性,最不建议使用AS-path属性

二.基本配置
1.R5路由器

hostname R5
interface Loopback0
ip address 5.5.5.5 255.255.255.0
interface Ethernet0/0
ip address 35.1.1.5 255.255.255.0
no shutdown
router bgp 65005
bgp router-id 5.5.5.5
neighbor 35.1.1.3 remote-as 65003
2.R3路由器
hostname R3
interface Loopback0
ip address 3.3.3.3 255.255.255.0
interface Ethernet0/0
ip address 23.1.1.3 255.255.255.0
no shutdown
interface Ethernet0/1
ip address 13.1.1.3 255.255.255.0
no shutdown
interface Ethernet0/2
ip address 35.1.1.3 255.255.255.0
no shutdown
router bgp 65003
bgp router-id 3.3.3.3
neighbor 13.1.1.1 remote-as 65004
neighbor 23.1.1.2 remote-as 65004
neighbor 35.1.1.5 remote-as 65005
network 3.3.3.0 mask 255.255.255.0
3.R1路由器
hostname R1
interface Loopback0
ip address 1.1.1.1 255.255.255.0
interface Ethernet0/1
ip address 13.1.1.1 255.255.255.0
no shutdown
interface Serial1/0
ip address 14.1.1.1 255.255.255.0
no shutdown
router ospf 1
router-id 1.1.1.1
passive-interface Loopback0
network 1.1.1.1 0.0.0.0 area 0
network 14.1.1.1 0.0.0.0 area 0
router bgp 65004
bgp router-id 1.1.1.1
neighbor 4.4.4.4 remote-as 65004
neighbor 4.4.4.4 update-source Loopback0
neighbor 4.4.4.4 next-hop-self
neighbor 13.1.1.3 remote-as 65003
4.R2路由器
hostname R2
interface Loopback0
ip address 2.2.2.2 255.255.255.0
ip ospf network point-to-point
interface Ethernet0/0
ip address 23.1.1.2 255.255.255.0
no shutdown
interface Ethernet0/1
ip address 24.1.1.2 255.255.255.0
ip ospf network point-to-point
no shutdown
router ospf 1
router-id 2.2.2.2
passive-interface Loopback0
network 2.2.2.2 0.0.0.0 area 0
network 24.1.1.2 0.0.0.0 area 0
router bgp 65004
bgp router-id 2.2.2.2
neighbor 4.4.4.4 remote-as 65004
neighbor 4.4.4.4 update-source Loopback0
neighbor 4.4.4.4 next-hop-self
neighbor 23.1.1.3 remote-as 65003
5.R4路由器
hostname R4
interface Loopback0
ip address 4.4.4.4 255.255.255.0
ip ospf network point-to-point
interface Ethernet0/1
ip address 24.1.1.4 255.255.255.0
ip ospf network point-to-point
no shutdown
interface Serial1/0
ip address 14.1.1.4 255.255.255.0
no shutdown
router ospf 1
router-id 4.4.4.4
passive-interface Loopback0
network 4.4.4.4 0.0.0.0 area 0
network 14.1.1.4 0.0.0.0 area 0
network 24.1.1.4 0.0.0.0 area 0
router bgp 65004
bgp router-id 4.4.4.4
neighbor 1.1.1.1 remote-as 65004
neighbor 1.1.1.1 update-source Loopback0
neighbor 1.1.1.1 next-hop-self
neighbor 2.2.2.2 remote-as 65004
neighbor 2.2.2.2 update-source Loopback0
network 4.4.4.0 mask 255.255.255.0
neighbor 2.2.2.2 next-hop-self
network 4.4.4.0 mask 255.255.255.0
三.BGP选路属性测试
1.weight属性测试
①配置之前查看R4上面的选路

R4#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
* i 3.3.3.0/24 1.1.1.1 0 100 0 65003 i
*>i 2.2.2.2 0 100 0 65003 i
*> 4.4.4.0/24 0.0.0.0 0 32768 i
R4#
②weight不能在out方向上设置
A.R1上配置route-map
access-list 3 permit 3.3.3.0
route-map SetWeight permit 10
match ip address 3
set weight 1
route-map SetWeight permit 20
B.R1在out方向应用route-map会报错
R1(config-route-map)#router bgp 65004
R1(config-router)#neighbor 4.4.4.4 route-map SetWeight out
% "SetWeight" used as BGP outbound route-map, set weight not supported
R1(config-router)#
③在R4针对R1邻居的in方向设置weight
A.R4上配置route-map
access-list 3 permit 3.3.3.0
route-map SetWeight permit 10
match ip address 3
set weight 1
route-map SetWeight permit 20
B.R4针对R1邻居的in方向应用route-map,可以看到R4的选路已经修改
router bgp 65004
neighbor 1.1.1.1 route-map SetWeight in
do clear ip bgp * soft
R4(config-router)#do clear ip bgp * soft
R4(config-router)#do show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*>i 3.3.3.0/24 1.1.1.1 0 100 1 65003 i
* i 2.2.2.2 0 100 0 65003 i
*> 4.4.4.0/24 0.0.0.0 0 32768 i
2.local-preference属性测试
①在R4上针对R2邻居in方向修改local-preference

A.R4上配置route-map
access-list 3 permit 3.3.3.0
route-map SetLocPrf permit 10
match ip address 3
set local-preference 101
route-map SetLocPrf permit 20
B.R4针对R2邻居的in方向应用route-map
router bgp 65004
neighbor 2.2.2.2 route-map SetLocPrf in
C.软清R2
R2#clear ip bgp * soft
D.可以看到R4上的local-preference已经修改,但是选路没有修改
R4(config-router)#do show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*>i 3.3.3.0/24 1.1.1.1 0 100 1 65003 i
* i 2.2.2.2 0 101 0 65003 i
*> 4.4.4.0/24 0.0.0.0 0 32768 i
E.R4上清除针对R1邻居的weight设置
router bgp 65004
no neighbor 1.1.1.1 route-map SetWeight in
do clear ip bgp * soft
F.软清R1
R1#clear ip bgp * soft
G.可以看到,R4的选路已经修改,因此可以确定weight优先级大于local-preference
R4(config-router)#do show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
* i 3.3.3.0/24 1.1.1.1 0 100 0 65003 i
*>i 2.2.2.2 0 101 0 65003 i
*> 4.4.4.0/24 0.0.0.0 0 32768 i
②local-preference也可以在邻居out方向修改
A.R1上配置route-map
access-list 3 permit 3.3.3.0
route-map SetLocPrf permit 10
match ip address 3
set local-preference 102
route-map SetLocPrf permit 20
B.R1针对R4邻居的out方向应用route-map
router bgp 65004
neighbor 4.4.4.4 route-map SetLocPrf out
C.R1软清
R1(config-router)#do clear ip bgp * soft
D.可以看到R4的选路已经修改
R4(config-router)#do show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*>i 3.3.3.0/24 1.1.1.1 0 102 0 65003 i
* i 2.2.2.2 0 101 0 65003 i
*> 4.4.4.0/24 0.0.0.0 0 32768 i
③local-preference可以向IBGP邻居传递
A.清除R4上配置
router bgp 65004
neighbor 2.2.2.2 route-map SetLocPrf in
do clear ip bgp * soft
B.清除R1上配置
router bgp 65004
no neighbor 4.4.4.4 route-map SetLocPrf out
do clear ip bgp * soft
C.R1配置route-map
access-list 3 permit 3.3.3.0
route-map SetLocPrf permit 10
match ip address 3
set local-preference 103
route-map SetLocPrf permit 20
D.R1针对EBGP邻居R3的in方向应用route-map,设置local-preference
router bgp 65004
neighbor 13.1.1.3 route-map SetLocPrf in
do clear ip bgp * soft
E.可以看到不仅R1上修改了local-preference,并且传递给了IBGP邻居R4
R1(config-router)#do show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 3.3.3.0/24 13.1.1.3 0 103 0 65003 i
r>i 4.4.4.0/24 4.4.4.4 0 100 0 i
R1(config-router)#
R4(config-router)#do show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*>i 3.3.3.0/24 1.1.1.1 0 103 0 65003 i
* i 2.2.2.2 0 100 0 65003 i
*> 4.4.4.0/24 0.0.0.0 0 32768 i
R4(config-router)#

3.AS-Path属性测试
①先查看R5上AS-path显示的顺序以及R3上的选路

R5#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 3.3.3.0/24 35.1.1.3 0 0 65003 i
*> 4.4.4.0/24 35.1.1.3 0 65003 65004 i
R5#
R4#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*>i 3.3.3.0/24 1.1.1.1 0 103 0 65003 i
* i 2.2.2.2 0 100 0 65003 i
*> 4.4.4.0/24 0.0.0.0 0 32768 i
R4#
备注:可以看到,去往路由的AS-path路径从左到右是先近后远的。
②在IBGP邻居设置AS-path无效
A. 在R1的IBGP的入口方式设置route-map增加AS
access-list 4 permit 4.4.4.0
route-map SetASpath permit 10
match ip address 4
set as-path prepend 1 2 3 4
route-map SetASpath permit 20
router bgp 65004
neighbor 4.4.4.4 route-map SetASpath in
do clear ip bgp * soft
R4#clear ip bgp * soft
R1#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 3.3.3.0/24 13.1.1.3 0 103 0 65003 i
r>i 4.4.4.0/24 4.4.4.4 0 100 0 i
R1#
B.在R4的IBGP的出口方式设置route-map增加AS
access-list 4 permit 4.4.4.0
route-map SetASpath permit 10
match ip address 4
set as-path prepend 1 2 3 4
route-map SetASpath permit 20
router bgp 65004
neighbor 1.1.1.1 route-map SetASpath out
do clear ip bgp * soft
R1#clear ip bgp * soft
R1#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 3.3.3.0/24 13.1.1.3 0 103 0 65003 i
r>i 4.4.4.0/24 4.4.4.4 0 100 0 i
R1#
③可以在EBGP的出入口方向设置route-map增加AS
A.在R3的EBGP的入口方式设置route-map增加AS
access-list 4 permit 4.4.4.0
route-map SetASpath permit 10
match ip address 4
set as-path prepend 1 2 3 4
route-map SetASpath permit 20
router bgp 65003
neighbor 23.1.1.2 route-map SetASpath in
do clear ip bgp * soft
R3#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 3.3.3.0/24 0.0.0.0 0 32768 i
*> 4.4.4.0/24 13.1.1.1 0 65004 i
* 23.1.1.2 0 1 2 3 4 65004 i
R3#
备注:可以看到,如果在人口方式增加AS-PATH,会在左侧增加,即不改变原有的path,在已有path之后追加。
另外,为了防止路由被丢弃,实际情况如果增加AS,建议增加自己的AS的AS号,或者私有AS号

B.在R2的EBGP的出口方式设置route-map增加AS
--配置之前,清除R3的配置
router bgp 65003
no neighbor 23.1.1.2 route-map SetASpath in
do clear ip bgp * soft
--配置R2
access-list 4 permit 4.4.4.0
route-map SetASpath permit 10
match ip address 4
set as-path prepend 1 2 3 4
route-map SetASpath permit 20
router bgp 65004
neighbor 23.1.1.3 route-map SetASpath out
do clear ip bgp * soft
R3#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 3.3.3.0/24 0.0.0.0 0 32768 i
*> 4.4.4.0/24 13.1.1.1 0 65004 i
* 23.1.1.2 0 65004 1 2 3 4 i
R3#
备注:可以看到,如果在出口方式增加AS-PATH,会在右侧增加,即在已有path路径之前追加,并且R3选路已经做了修改,选择了AS-Path短的路径。
④R3可以设置接收最多AS号的路由
router bgp 65003
bgp maxas-limit 4
do clear ip bgp * soft
R3(config-router)#
*Mar 18 07:59:54.478: %BGP-6-MSGDUMP_LIMIT: unsupported or mal-formatted message received from 23.1.1.2:
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 003F 0200 0000 2440 0101 0040 0216 0205
0000 FDEC 0000 0001 0000 0002 0000 0003 0000 0004 4003 0417 0101 0218 0404 04
*Mar 18 07:59:54.478: %BGP-6-ASPATH: Long AS path 65004 1 2 3 4 received from 23.1.1.2: BGP(0) Prefixes: 4.4.4.0/24
R3(config-router)#do show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 4.4.4.0/24 13.1.1.1 0 65004 i
R3(config-router)#
备注:可以看到,如果设置AS号最多为4个时,如果接收到包含4个AS号的路由的时候会丢弃,另外,如果在R3的入口方向增加AS-PATH,增加后的路径大于最大值没有影响。
⑤EBGP默认如果收到的路由包含自己的AS号,则丢弃,不过可以修改(不建议)
A.清除R2上配置
router bgp 65004
no neighbor 23.1.1.3 route-map SetASpath out
do clear ip bgp * soft
B.清除R3上配置
router bgp 65003
no bgp maxas-limit 4
do clear ip bgp * soft
C.在R2上配置
access-list 4 permit 4.4.4.0
route-map SetASpath permit 10
match ip address 4
set as-path prepend 1 65003
route-map SetASpath permit 20
router bgp 65004
neighbor 23.1.1.3 route-map SetASpath out
do clear ip bgp * soft
D.查看效果
R3#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 3.3.3.0/24 0.0.0.0 0 32768 i
*> 4.4.4.0/24 13.1.1.1 0 65004 i
R3#
备注:可以看到,R3丢弃了包含自己AS号的路由
E.修改R3的配置
router bgp 65003
neighbor 23.1.1.2 allowas-in
do clear ip bgp * soft
F.查看效果
R3#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 3.3.3.0/24 0.0.0.0 0 32768 i
* 4.4.4.0/24 23.1.1.2 0 65004 1 65003 i
*> 13.1.1.1 0 65004 i
R3#
⑥此时如果在R3上设置R2邻居in方向的local-preference,可以修改R3上路由选择,说明local-preference优先级高于AS-path
A.R3上配置route-map
access-list 4 permit 4.4.4.0
route-map SetLocPrf permit 10
match ip address 4
set local-preference 101
route-map SetLocPrf permit 20
B.R3针对R2邻居in方向应用route-map,增加local-preference
router bgp 65003
neighbor 23.1.1.2 route-map SetLocPrf in
do clear ip bgp * soft
C.R2进行软清
R2(config-router)#do clear ip bgp * soft
D.可以看到R3上路径已经改变,选择了AS-path长,但local-preference大的路径
R3#show ip bgp | be
R3#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 3.3.3.0/24 0.0.0.0 0 32768 i
*> 4.4.4.0/24 23.1.1.2 101 0 65004 1 65003 i
* 13.1.1.1 0 65004 i
R3#
⑦让路由器不比较as-path
bgp bestpath as-path ignore (为隐藏命令,问号不会显示)
4.Origin属性测试
①清除之前的配置,让R3恢复默认选路

R3#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 3.3.3.0/24 0.0.0.0 0 32768 i
* 4.4.4.0/24 13.1.1.1 0 65004 i
*> 23.1.1.2 0 65004 i
R3#
②R4上针对邻居R2的out方向设置起源属性为incomplete
A.R4上配置
access-list 4 permit 4.4.4.0
route-map SetOrigin permit 10
match ip address 4
set origin incomplete
route-map SetOrigin permit 20
router bgp 65004
neighbor 2.2.2.2 route-map SetOrigin out
do clear ip bgp * soft
B.查看R3的选路,已经做了修改
R3#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 3.3.3.0/24 0.0.0.0 0 32768 i
*> 4.4.4.0/24 13.1.1.1 0 65004 i
* 23.1.1.2 0 65004 ?
R3#
③R1上针对邻居R3设置AS-path属性,增加AS
A.R1上配置
access-list 4 permit 4.4.4.0
route-map SetAsPath permit 10
match ip address 4
set as-path prepend 65004
route-map SetAsPath permit 20
router bgp 65004
neighbor 13.1.1.3 route-map SetAsPath out
do clear ip bgp * soft
B.查看R3的选路,已经做了修改
R3#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 3.3.3.0/24 0.0.0.0 0 32768 i
* 4.4.4.0/24 13.1.1.1 0 65004 65004 i
*> 23.1.1.2 0 65004 ?
R3#
备注:可以看出,AS-path的优先级要大于起源属性。
5.Med属性测试
①清除之前的配置,查看R3针对4.4.4.0的选路,走R1

R3#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 3.3.3.0/24 0.0.0.0 0 32768 i
* 4.4.4.0/24 23.1.1.2 0 65004 i
*> 13.1.1.1 0 65004 i
R3#
备注:清除配置,重置配置,这次却与之前的不一样,可能时模拟器的原因。
②R1针对EBGP邻居R3配置route-map,增加MED
A.R1配置route-map
access-list 4 permit 4.4.4.0
route-map SetMED permit 10
match ip address 4
set metric 10
route-map SetMED permit 20
B.R1针对EBGP邻居R2应用route-map
router bgp 65004
neighbor 13.1.1.3 route-map SetMED out
do clear ip bgp * soft
C.查看R3的选路已经做了修改,现在4.4.4.0下一跳走R2
R3#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 3.3.3.0/24 0.0.0.0 0 32768 i
*> 4.4.4.0/24 23.1.1.2 0 65004 i
* 13.1.1.1 10 0 65004 i
R3#
D.在R5上面查看,可以看出metric不会传递下一个AS
R5#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 3.3.3.0/24 35.1.1.3 0 0 65003 i
*> 4.4.4.0/24 35.1.1.3 0 65003 65004 i
R5#
E.在R2上针对邻居R3设置route-map,增加AS
access-list 4 permit 4.4.4.0
route-map SetASpath permit 10
match ip address 4
set as-path prepend 65004
route-map SetASpath permit 20
router bgp 65004
neighbor 23.1.1.3 route-map SetASpath out
do clear ip bgp * soft
F.可以看到R3针对4.4.4.0下一跳已经修改,走R1,说明AS-path优先级大于MED
R3#show ip bgp | BEgin Network
Network Next Hop Metric LocPrf Weight Path
*> 3.3.3.0/24 0.0.0.0 0 32768 i
* 4.4.4.0/24 23.1.1.2 0 65004 65004 i
*> 13.1.1.1 10 0 65004 i
R3#
③R3针对EBGP邻居R2配置route-map,增加MED
A.配置先查看R4上针对3.3.3.0的选路,走R2,因为带宽高
R4#show ip bgp | Begin Network
Network Next Hop Metric LocPrf Weight Path
*>i 3.3.3.0/24 2.2.2.2 0 100 0 65003 i
* i 1.1.1.1 0 100 0 65003 i
*> 4.4.4.0/24 0.0.0.0 0 32768 i
R4#
B.R3针对EBGP邻居R2配置route-map,增加MED
access-list 3 permit 3.3.3.0
route-map SetMED permit 10
match ip address 3
set metric 1
route-map SetMED permit 20
router bgp 65003
neighbor 23.1.1.2 route-map SetMED out
do clear ip bgp * soft
C.这时查看R4上针对3.3.3.0的下一跳已经修改,走R1,说明MED能在邻居的AS内部传递
R4#show ip bgp | BEgin Network
Network Next Hop Metric LocPrf Weight Path
* i 3.3.3.0/24 2.2.2.2 1 100 0 65003 i
*>i 1.1.1.1 0 100 0 65003 i
*> 4.4.4.0/24 0.0.0.0 0 32768 i
R4#
④设置思科路由默认MED为最大值
A.清除R1上增加med值的设置
router BGP 65004
no neighbor 13.1.1.3 route-map SetMED out
do clear ip bgp * soft
B.R3上执行相应命令
router BGP 65004
bgp bestpath med missing-as-worst
do clear ip bgp * soft
B.可以看到,R3配置完成后,会把所有的接收EBGP路由的metric设置的非常大
R3#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 3.3.3.0/24 0.0.0.0 0 32768 i
*> 4.4.4.0/24 13.1.1.1 4294967295 0 65004 i
* 23.1.1.2 4294967295 0 65004 65004 i
R3#
C.这时R5发布一条路由5.5.5.0/24,不知道为什么,R3不会针对此路由修改默认metric值
R3#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 3.3.3.0/24 0.0.0.0 0 32768 i
*> 4.4.4.0/24 13.1.1.1 4294967295 0 65004 i
* 23.1.1.2 4294967295 0 65004 65004 i
*> 5.5.5.0/24 35.1.1.5 0 0 65005 i
R3#
D.R5上执行相同的命令,发现R5只是针对4.4.4.0的路由设置了meitric,针对3.3.3.0没有
router BGP 65005
bgp bestpath med missing-as-worst
do clear ip bgp * soft
R5#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 3.3.3.0/24 35.1.1.3 0 0 65003 i
*> 4.4.4.0/24 35.1.1.3 4294967295 0 65003 65004 i
*> 5.5.5.0/24 0.0.0.0 0 32768 i
R5#
E.把所有路由器no router bgp ,再重新配置,并在所有路由器上面配置bgp bestpath med missing-as-worst
R5#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 3.3.3.0/24 35.1.1.3 0 0 65003 i
*> 4.4.4.0/24 35.1.1.3 4294967295 0 65003 65004 i
*> 5.5.5.0/24 0.0.0.0 0 32768 i
R5#
R3#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 3.3.3.0/24 0.0.0.0 0 32768 i
* 4.4.4.0/24 13.1.1.1 4294967295 0 65004 i
*> 23.1.1.2 4294967295 0 65004 i
*> 5.5.5.0/24 35.1.1.5 0 0 65005 i
R3#
R1#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 3.3.3.0/24 13.1.1.3 0 0 65003 i
r>i 4.4.4.0/24 4.4.4.4 0 100 0 i
*> 5.5.5.0/24 13.1.1.3 4294967295 0 65003 65005 i
R1#
R2#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 3.3.3.0/24 23.1.1.3 0 0 65003 i
r>i 4.4.4.0/24 4.4.4.4 0 100 0 i
*> 5.5.5.0/24 23.1.1.3 4294967295 0 65003 65005 i
R2#
R4#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
* i 3.3.3.0/24 1.1.1.1 0 100 0 65003 i
*>i 2.2.2.2 0 100 0 65003 i
*> 4.4.4.0/24 0.0.0.0 0 32768 i
* i 5.5.5.0/24 1.1.1.1 4294967295 100 0 65003 65005 i
*>i 2.2.2.2 4294967295 100 0 65003 65005 i
R4#
备注:从上面结果来看,bgp bestpath med missing-as-worst命令会把非EBGP邻居学习到的EBGP路由的metric设置一个很大的值
另外,R4因为没有EBGP邻居,配置和不配置相同,metric由IBGP邻居传递过来的。

评论
likuo
Spotlight
Spotlight
这个测试比较有意思。
入门指南

使用上面的搜索栏输入关键字、短语或问题,搜索问题的答案。

我们希望您在这里的旅程尽可能顺利,因此这里有一些链接可以帮助您快速熟悉思科社区:









快捷链接