在我的华为 CE12800 设备上,我正在尝试运行此配置。除了标准的 BGP 流程外,我还使用三个社区值来控制与上游提供商的流量。有了 555 的社区价值,我可以阻止来自国际的流量。10.20.30.3 应该只能从我的本地网络和上游网络访问。尽管我可以成功地宣布 10.20.30.3 与 555 社区,但是到 NULL 接口的静态 ip 路由阻止了流量。我需要一个虚拟路由条目来启动不阻塞本地流量的 BGP 通告。
顺便说一句,此设置适用于我的旧 3com 8800 设备。
#
interface Vlanif1000
ip address 10.20.30.1 255.255.255.240
#
bgp 11111
group UPSTREAM external
peer UPSTREAM as-number 22222
peer 11.22.33.44 as-number 22222
peer 11.22.33.44 group UPSTREAM
#
ipv4-family unicast
dampening
default-route imported
network 10.20.30.0 255.255.255.0
network 10.20.30.3 255.255.255.255
peer UPSTREAM enable
peer UPSTREAM route-policy export_upstream export
peer UPSTREAM advertise-community
peer 11.22.33.44 enable
peer 11.22.33.44 group UPSTREAM
#
route-policy export_upstream permit node 5
if-match ip-prefix black_hole
apply community 22222:666
#
route-policy export_upstream permit node 6
if-match ip-prefix upstream_int2
apply community 22222:555
#
route-policy export_upstream permit node 7
if-match ip-prefix upstream_int1
apply community 22222:444
#
route-policy export_upstream permit node 10
if-match ip-prefix local_upstream
apply local-preference 25
#
ip ip-prefix local_upstream index 84 permit 10.20.30.0 24 greater-equal 24 less-equal 32
ip ip-prefix black_hole index 10 permit 172.16.0.2 32 greater-equal 32 less-equal 32
ip ip-prefix upstream_int1 index 10 permit 172.16.0.4 32 greater-equal 32 less-equal 32
ip ip-prefix upstream_int2 index 10 permit 172.16.0.3 32 greater-equal 32 less-equal 32
ip ip-prefix upstream_int2 index 34714 permit 10.20.30.3 32
#
ip route-static 0.0.0.0 0.0.0.0 11.22.33.44
ip route-static 10.20.30.0 255.255.255.0 NULL0 description BGPTEST
ip route-static 10.20.30.3 255.255.255.255 NULL0