I’m new to ROS. Cisco/Linux/FreeBSD before. Please help me understand my mistake with ROS. The standard trick for other OSes is:
We route a whole network (A.A.0.0/20 for example) to blackhole. The reason - to drop incoming traffic for segments we do not route this time.
ip route A.A.0.0 255.255.240.0 Null0 in Cisco words
The we announce network via bgp
router bgp XXX
network A.A.0.0/20 route-map rm-A.A.0.0/20
We use this prefix in our outbound filters
…
I tried same trick with ROS and failed. I did:
/ip route add dst-address=A.A.0.0/20 type=blackhole
I used
/routing bgp network add A.A.0.0/20 synchronize=no
I used global bgp out filter to set bgp communities:
/routing filter
remove [find chain=rm-bgp-localas]
add chain=rm-bgp-localas protocol=bgp action=accept prefix=A.A.0.0/20 set-bgp-local-pref=900 set-bgp-communities=30910:900
add chain=rm-bgp-localas protocol=“connect,static” action=accept set-bgp-local-pref=900 set-bgp-communities=local-as,30910:900
And … I can’t see prefix A.A.0.0/20 in advertisiments I thinking this is because there are two prefixes, static and bgp. static is with local-as attribute and it is preferred over bgp when choosing for advertise?
HI!
I’m almost in your situation - not enough experience with ROS as bgp/ospf router, and with its some kind of unusual (for me) configuration commands/filters I do not know when some thing is a bug and when it is a feature
I suspect I have the same problem, and just to be sure I do not need to open another topic - would you check if this network isn’t in fact advertised? In my case, the network is not listed as advertised, but in fact IS advertised, and is received, accepted and installed by the bgp peers.
I think the Advertisement tab is not completely bug-free at the moment, as you point out indeed some networks
are advertised even though they do not appear there. (but do appear as BGP network and pass through the filters)
Hi, Borisk - one quick detail I noticed in your post is that you have set synchronize=no on your /20 network - you should go change that to yes. (Winbox defaults to having the checkbox unchecked, but if you issue the network add command from the command line, synchronize actually defaults to “yes” as it should)
With synch=no, the router will originate the prefix regardless of whether it exists in the routing table - i.e. the blackhole route is not necessary. I actually hit a bug once regarding the global BGP filter and synchronize changing from no to yes. The bug caused the router to think it withdrew a route but forgot to actually send the NLRI withdrawing the prefix…
In general, I’d recommend against using redistribution to originate routes into BGP. Add network statements for each prefix you’re looking to add to your table.
First off, you have this filter (rm-bgp-localas) defined as the ‘Out filter’ for your bgp peers, correct?
What you need to do is accept the A.A.0.0/20 prefix and set the bgp properties you need.
Then (I presume) you discard everything else.
That way you only announce the A.A.0.0/20 prefix to your peers.