BGP不可比较的AS间的度量问题的解决办法


不可比较的AS间的度量问题的解决办法
使用全互连的IBGP
打开always-compare-MED
打开deterministic-MED
把MED值重置为0
使用团体属性

Platform:cisco iou

step 1:load config file (basic_config.txt)

这时候请观察R1,R2,R3,R4去往7.7.7.7的下一跳。


根据上图所示,去往7.7.7.7 都不是最低MED的。

step 2:在R1,R2,R3,R4都输入 bgp always-compare-med ,再去查看R1

R1++++++++++++++++++++++++++++++++++++++++++++++++++++

interface Loopback0
 ip address 1.1.1.1 255.255.255.255
!
interface Ethernet0/0
no sh
!
interface Ethernet0/0.12
 encapsulation dot1Q 12
 ip address 12.1.1.1 255.255.255.0
!         
interface Ethernet0/0.13
 encapsulation dot1Q 13
 ip address 13.1.1.1 255.255.255.0
!
interface Ethernet0/0.14
 encapsulation dot1Q 14
 ip address 14.1.1.1 255.255.255.0
!
router ospf 100
 network 0.0.0.0 255.255.255.255 area 0
!
router bgp 100
 bgp log-neighbor-changes
 neighbor 2.2.2.2 remote-as 100
 neighbor 2.2.2.2 update-source Loopback0
 neighbor 2.2.2.2 route-reflector-client
 neighbor 3.3.3.3 remote-as 100
 neighbor 3.3.3.3 update-source Loopback0
 neighbor 3.3.3.3 route-reflector-client
 neighbor 4.4.4.4 remote-as 100
 neighbor 4.4.4.4 update-source Loopback0
 neighbor 4.4.4.4 route-reflector-client
 no auto-summary

R2++++++++++++++++++++++++++++++++++++++++++++++

interface Loopback0
 ip address 2.2.2.2 255.255.255.255
!
interface Ethernet0/0
no sh
!
interface Ethernet0/0.12
 encapsulation dot1Q 12
 ip address 12.1.1.2 255.255.255.0
!
interface Ethernet0/0.25
 encapsulation dot1Q 25
 ip address 25.1.1.2 255.255.255.0
!
router ospf 100
 network 2.2.2.2 0.0.0.0 area 0
 network 12.1.1.2 0.0.0.0 area 0
!
router bgp 100
 bgp log-neighbor-changes
 neighbor 1.1.1.1 remote-as 100
 neighbor 1.1.1.1 update-source Loopback0
 neighbor 1.1.1.1 next-hop-self
 neighbor 25.1.1.5 remote-as 200
 neighbor 25.1.1.5 route-map F5 in
 no auto-summary
R3+++++++++++++++++++++++++++++++++++++++++++++++++++++

interface Loopback0
 ip address 3.3.3.3 255.255.255.255
!
interface Ethernet0/0
no sh
!
interface Ethernet0/0.13
 encapsulation dot1Q 13
 ip address 13.1.1.3 255.255.255.0
!
interface Ethernet0/0.36
 encapsulation dot1Q 36
 ip address 36.1.1.3 255.255.255.0
!  
router ospf 100
 network 3.3.3.3 0.0.0.0 area 0
 network 13.1.1.3 0.0.0.0 area 0
!
router bgp 100
 bgp log-neighbor-changes
 neighbor 1.1.1.1 remote-as 100
 neighbor 1.1.1.1 update-source Loopback0
 neighbor 1.1.1.1 next-hop-self
 neighbor 36.1.1.6 remote-as 300
 neighbor 36.1.1.6 route-map F6 in
 no auto-summary
!

R4++++++++++++++++++++++++++++++++++++++++++++++++++++++++

interface Loopback0
 ip address 4.4.4.4 255.255.255.255
!
interface Ethernet0/0
no sh
!
interface Ethernet0/0.14
 encapsulation dot1Q 14
 ip address 14.1.1.4 255.255.255.0
!
interface Ethernet0/0.46
 encapsulation dot1Q 46
 ip address 46.1.1.4 255.255.255.0
!  
router ospf 100
 network 4.4.4.4 0.0.0.0 area 0
 network 14.1.1.4 0.0.0.0 area 0
!
router bgp 100
 bgp log-neighbor-changes
 neighbor 1.1.1.1 remote-as 100
 neighbor 1.1.1.1 update-source Loopback0
 neighbor 1.1.1.1 next-hop-self
 neighbor 46.1.1.6 remote-as 300
 neighbor 46.1.1.6 route-map F6 in
 no auto-summary

R5++++++++++++++++++++++++++++++++++++++++++++++++++

interface Loopback0
 ip address 5.5.5.5 255.255.255.255
!
interface Ethernet0/0
no sh
!
interface Ethernet0/0.25
 encapsulation dot1Q 25
 ip address 25.1.1.5 255.255.255.0
!
interface Ethernet0/0.57
 encapsulation dot1Q 57
 ip address 57.1.1.5 255.255.255.0

router bgp 200
 bgp log-neighbor-changes
 network 5.5.5.5 mask 255.255.255.255
 neighbor 25.1.1.2 remote-as 100
 neighbor 57.1.1.7 remote-as 400
 no auto-summary
!

R6+++++++++++++++++++++++++++++++++++++++++++++++

interface Loopback0
 ip address 6.6.6.6 255.255.255.255
!
interface Ethernet0/0
no sh
!
interface Ethernet0/0.36
 encapsulation dot1Q 36
 ip address 36.1.1.6 255.255.255.0
!
interface Ethernet0/0.46
 encapsulation dot1Q 46
 ip address 46.1.1.6 255.255.255.0
!
interface Ethernet0/0.67
 encapsulation dot1Q 67
 ip address 67.1.1.6 255.255.255.0
!
router bgp 300
 bgp log-neighbor-changes
 network 6.6.6.6 mask 255.255.255.255
 neighbor 36.1.1.3 remote-as 100
 neighbor 46.1.1.4 remote-as 100
 no auto-summary

R7++++++++++++++++++++++++++++++++++++++++++++

interface Loopback0
 ip address 7.7.7.7 255.255.255.255
!
interface Ethernet0/0
no sh
!
interface Ethernet0/0.57
 encapsulation dot1Q 57
 ip address 57.1.1.7 255.255.255.0
!
interface Ethernet0/0.67
 encapsulation dot1Q 67
 ip address 67.1.1.7 255.255.255.0
!     
router bgp 400
 bgp log-neighbor-changes
 network 7.7.7.7 mask 255.255.255.255
 neighbor 57.1.1.5 remote-as 200
 neighbor 67.1.1.6 remote-as 300
 no auto-summary
 

原文地址:https://www.cnblogs.com/cyrusxx/p/12824208.html