Quagga eBGP 路由广告不会传播到 iBGP 会话中

网络工程 路由 bgp 斑驴
2021-07-20 20:19:14

我正在尝试这样做:通过多个本地路由器双归属到一个 ISP 时的负载共享与示例的唯一区别是 ISP发送的是完整的 BGP 表而不是默认网关我有一个问题,R101 不会将外部路由通告给 R102,这会在 R102 的上游对等方断开连接时导致问题,并且 R102 丢失所有路由。

我的配置:

R101运行配置:

router bgp 6001
 no synchronization
 bgp router-id 1.1.2.253
 bgp log-neighbor-changes
 network 1.1.1.0
 network 1.1.2.0
 neighbor 2.1.1.249 remote-as 6000
 neighbor 2.1.1.249 soft-reconfiguration inbound
 neighbor 2.1.1.249 prefix-list 3 in
 neighbor 2.1.1.249 route-map R1-DC-MAP out
 neighbor 1.1.2.254 remote-as 6001
 neighbor 1.1.2.254 next-hop-self
 neighbor 1.1.2.254 soft-reconfiguration inbound
 maximum-paths 2
 no auto-summary
!
ip prefix-list 1 seq 5 permit 1.1.1.0/24
ip prefix-list 2 seq 5 permit 1.1.2.0/24
ip prefix-list 3 seq 5 deny 1.1.1.0/23
ip prefix-list 3 seq 10 permit any
!
route-map R1-DC-MAP permit 10
 match ip address prefix-list 1
 set as-path prepend 6001 6001 6001
!
route-map R1-DC-MAP permit 20
 match ip address prefix-list 2
!
route-map R1-DC-MAP deny 200

R102运行配置:

router bgp 6001
 no synchronization
 bgp router-id 1.1.2.254
 bgp log-neighbor-changes
 network 1.1.1.0
 network 1.1.2.0
 neighbor 3.1.1.25 remote-as 6000
 neighbor 3.1.1.25 soft-reconfiguration inbound
 neighbor 3.1.1.25 prefix-list 3 in
 neighbor 3.1.1.25 route-map R2-SIX-MAP out
 neighbor 1.1.2.253 remote-as 6001
 neighbor 1.1.2.253 next-hop-self
 neighbor 1.1.2.253 soft-reconfiguration inbound
 maximum-paths 2
 no auto-summary
!
ip prefix-list 1 seq 5 permit 1.1.2.0/24
ip prefix-list 2 seq 5 permit 1.1.1.0/24
ip prefix-list 3 seq 5 deny 1.1.1.0/23
ip prefix-list 3 seq 10 permit any
!
route-map R2-SIX-MAP permit 10
 match ip address prefix-list 1
 set as-path prepend 6001 6001 6001
!
route-map R2-SIX-MAP permit 20
 match ip address prefix-list 2
!
route-map R2-SIX-MAP deny 30
 match ip address 1.1.1.0/23
!
route-map R2-SIX-MAP deny 200
!
ip forwarding
!
line vty
!
end

R101接口列表:

Interface vlan3 is up, line protocol detection is disabled
  inet 1.1.1.253/30 broadcast 1.1.1.255

Interface vlan4 is up, line protocol detection is disabled
  inet 2.1.1.253/29 broadcast 2.1.1.255

Interface vlan101 is up, line protocol detection is disabled
  inet 1.1.1.61/26 broadcast 1.1.1.63
  inet 1.1.1.1/32 broadcast 1.1.1.1

Interface vlan106 is up, line protocol detection is disabled
  inet 1.1.1.125/27 broadcast 1.1.1.127
  inet 1.1.1.97/32 broadcast 1.1.1.97

Interface vlan107 is up, line protocol detection is disabled
  inet 1.1.1.141/28 broadcast 1.1.1.143
  inet 1.1.1.129/28 broadcast 1.1.1.143 secondary

Interface vlan109 is up, line protocol detection is disabled
  inet 1.1.1.93/27 broadcast 1.1.1.95
  inet 1.1.1.65/32 broadcast 1.1.1.65

R102接口配置:

Interface vlan3 is up, line protocol detection is disabled
  inet 1.1.2.254/30 broadcast 1.1.2.255

Interface vlan4 is up, line protocol detection is disabled
  inet 3.1.1.29/29 broadcast 3.1.1.31

Interface vlan101 is up, line protocol detection is disabled
  inet 1.1.2.62/26 broadcast 1.1.2.63
  inet 1.1.2.1/32 broadcast 1.1.2.1

Interface vlan106 is up, line protocol detection is disabled
  inet 1.1.2.126/27 broadcast 1.1.2.127
  inet 1.1.2.97/32 broadcast 1.1.2.97

Interface vlan107 is up, line protocol detection is disabled
  inet 1.1.2.142/28 broadcast 1.1.2.143
  inet 1.1.2.129/28 broadcast 1.1.2.143 secondary

Interface vlan109 is up, line protocol detection is disabled
  inet 1.1.2.94/27 broadcast 1.1.2.95
  inet 1.1.2.65/32 broadcast 1.1.2.65

广告在 R101 上根本不起作用,但我可以看到来自 R102 的广告。与上游 ISP BGP 对等方的通信按预期工作,我正在从他们那里获得完整的 BGP。

R101广告:

BGP table version is 0, local router ID is 1.1.2.253
Status codes: s suppressed, d damped, h history, * valid, > best, = multipath,
              i internal, r RIB-failure, S Stale, R Removed
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path

R101 接收路由:

BGP table version is 0, local router ID is 1.1.2.253
Status codes: s suppressed, d damped, h history, * valid, > best, = multipath,
              i internal, r RIB-failure, S Stale, R Removed
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 1.1.1.0     1.1.2.254           0    100      0 i
*> 1.1.2.0     1.1.2.254           0    100      0 i

Total number of prefixes 2

有没有人有任何想法可能有什么问题?

2个回答

BGP 路由器配置中的网络语句:

network 1.1.1.0
network 1.1.2.0

与实际网络地址不匹配,范围从/26/32除非您使用该命令,否则BGP 不会通告与路由表中的内容完全匹配的网络aggregate-addressBGP 中的网络语句不会组成不存在的路由。

我想问题出在您对 1.1.1.0/24 和 1.1.2.0/24 的支持路线上

要宣布前缀,您需要 RIB 中的支持路由。因此,您应该在 RIB 中有 1.1.1.0/24 和 1.1.2.0/24 才能宣布它们。

我假设你不能改变你的 SVI 的 IP 地址,因此你可以输入两条 /24 路由​​到你的网络以南,或者到 Null0。BGP network 命令才会生效。