华为6851不能在BGP中通告/32子网

网络工程 华为
2022-02-13 13:56:42

我有一个华为 6851-48s6q,我有几个 vlanif 接口和 2 个连接到此交换机的 ip 传输,我在这些 vlanif 上设置了一些公共 ip,例如 213.xx1/29 和 213.xy33/29,这是我的bgp配置

route-policy DT-Blackhole permit node 10

 apply local-preference 450

 apply community 12345:666

 apply preference 255

 

 route-policy IPTRANSIT-OUT permit node 10

 if-match community-filter Blackhole

 apply community 98765:666

 

 ip community-filter basic Blackhole index 10 permit 12345:666



 bgp 12345

  ipv4-family unicast

  preference 120 110 255

  network 213.x.x.1 255.255.255.255 route-policy DT-Blackhole

当我执行 display bgp routing 213.xx1/32 我可以看到,这是输出:

display bgp routing-table 213.x.x.1
 BGP local router ID : 172.x.x.14
 Local AS number : 12345
 Paths:   2 available, 1 best, 1 select, 0 best-external, 0 add-path
 BGP routing table entry information of 213.x.x.1/32:
 Network route.
 From: 0.0.0.0 (0.0.0.0)
 Route Duration: 0d00h18m10s
 Direct Out-interface: 40GE1/0/1
 Original nexthop: 127.0.0.1
 Qos information : 0x0
 Community: <12345:666>
 AS-path Nil, origin igp, MED 0, pref-val 0, valid, local, best, select, pre 0
 Not advertised to any peer yet

这是接口vlan配置:

interface Vlanif684
 ip address 213.x.x.1/29 255.255.255.248

我无法配置为什么 213.xx1/32 没有向我的 ip 传输通知,我多次检查了我的路由策略,其他前缀工作正常,只是分配给 vlanif 的 ip 没有被宣布,

1个回答

您只能通告存在于您的 RIB 中的网络,并且它们只能作为路由条目中的掩码进行通告。因此,如果它是 /29 网络,则必须将其宣传为 /29。如果你想通告 /32,你需要在你的设备上添加一个路由(真实的或空的,取决于它需要去的地方),这样它就在 RIB 中,然后 BGP 将宣布该路由。