我有一个名为rtbh的路由策略,它被配置为BGP对等点的入口策略:
root@PE3> show configuration policy-options policy-statement rtbh term ipv4 | display inheritance no-comments
from {
family inet;
community BLACKHOLE;
route-filter 0.0.0.0/0 prefix-length-range /32-/32;
}
then {
local-preference 170;
origin igp;
next-hop 192.0.2.1;
accept;
}
root@PE3>如上面所示,如果它有一个特定的BGP社区,那么它就匹配一个/32前缀,然后将下一跳重写到192.0.2.1并接受该前缀。192.0.2.1的路径是存在的:
root@PE3> show route 192.0.2.1 detail
inet.0: 17 destinations, 18 routes (16 active, 0 holddown, 1 hidden)
192.0.2.1/32 (1 entry, 1 announced)
*Static Preference: 5
Next hop type: Discard, Next hop index: 0
Address: 0xa1de64c
Next-hop reference count: 2
State: <Active NoReadvrt Int Ext>
Local AS: 65005
Age: 1
Validation State: unverified
Task: RT
Announcement bits (2): 0-KRT 4-Resolve tree 1
AS path: I
root@PE3>
root@PE3> ...configuration routing-options rib inet.0 | display inheritance no-comments
static {
route 192.0.2.1/32 {
discard;
install;
no-readvertise;
}
}
martians {
192.0.2.1/32 exact allow;
}
root@PE3>但是,当我收到rtbh策略的匹配前缀时,它将保持隐藏状态:
root@PE3> show route receive-protocol bgp 10.94.0.1 extensive hidden
inet.0: 17 destinations, 18 routes (16 active, 0 holddown, 1 hidden)
203.0.113.1/32 (1 entry, 0 announced)
Accepted
Nexthop: 10.94.0.1
AS path: 65004 I
Communities: 65005:666
inet6.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
root@PE3>当我删除next-hop 192.0.2.1策略中的rtbh语句时,203.0.113.1/32就会成为活动的。是什么导致了这种行为?
发布于 2020-11-16 19:30:30
问题是在BGP邻居上缺乏accept-remote-nexthop配置。Junos正在应用您的入口策略-语句,然后进行验证检查。这可能不是它应该如何工作,但这是一个青少年主义。这个“特性”的文档很糟糕,但是这里是链接。
如果您不喜欢配置accept-remote-nexthop,那么另一种实现RTBH的方法是使用forwarding-table export策略来匹配RTBH路由(例如,通过社区),并在将这些路由安装到FIB后将下一跳重写到discard。
https://networkengineering.stackexchange.com/questions/71020
复制相似问题