路由器的配置非常简单。路由器 BGP1:
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface Loopback9
ip address 9.9.9.9 255.255.255.255
!
interface GigabitEthernet0/1
ip address 10.0.0.1 255.255.255.0
!
router bgp 1
bgp log-neighbor-changes
redistribute connected
neighbor 10.0.0.2 remote-as 1
neighbor 10.0.0.2 next-hop-self
路由器 BGP2:
interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
interface GigabitEthernet0/1
ip address 10.0.0.2 255.255.255.0
!
interface GigabitEthernet0/3
ip address 20.0.0.1 255.255.255.0
!
router bgp 1
bgp log-neighbor-changes
redistribute connected
neighbor 10.0.0.1 remote-as 1
neighbor 10.0.0.1 next-hop-self
neighbor 20.0.0.2 remote-as 1
neighbor 20.0.0.2 next-hop-self
路由器 BGP3:
interface Loopback0
ip address 3.3.3.3 255.255.255.255
!
interface GigabitEthernet0/3
ip address 20.0.0.2 255.255.255.0
!
router bgp 1
bgp log-neighbor-changes
redistribute connected
neighbor 20.0.0.1 remote-as 1
neighbor 20.0.0.1 next-hop-self
所以我将接口 loopback9 添加到路由器 BGP1 以查看它是否通过 BGP3。但这种情况并非如此。我可以看到从 BGP1 进入 BGP2 的路由:
BGP2#show ip route bgp | begin 1.0
1.0.0.0/32 is subnetted, 1 subnets
B 1.1.1.1 [200/0] via 10.0.0.1, 00:10:07
3.0.0.0/32 is subnetted, 1 subnets
B 3.3.3.3 [200/0] via 20.0.0.2, 00:10:07
9.0.0.0/32 is subnetted, 1 subnets
B 9.9.9.9 [200/0] via 10.0.0.1, 00:10:07
但这不会被通告给路由器 BGP3:
BGP2#show ip bgp neighbors 20.0.0.2 advertised-routes | begin Networ
Network Next Hop Metric LocPrf Weight Path
*> 2.2.2.2/32 0.0.0.0 0 32768 ?
*> 10.0.0.0/24 0.0.0.0 0 32768 ?
*> 20.0.0.0/24 0.0.0.0 0 32768 ?
在所有设备上禁用 IGP 同步:
BGP2# show ip protocols | include synch
IGP synchronization is disabled
那么我该如何解决这个问题?我知道您应该在 BGP 下运行 IGP,但让我们假设在这种情况下这是不可能的。我有哪些选择?