05-27-2016 07:57 AM - edited 03-05-2019 04:06 AM
Hi all,
I have a simple topology, where R1 is connected to R2 with a BGP session between them.
On R1, I have a static route: 10.0.130.0 255.255.255.0 192.168.0.1
I just want send to R2 only prefixes 10.0.130.18/32 and 10.0.130.58/32, not all 10.0.130.0/24 network
Is there a way to accomplish that?
Thank you
05-27-2016 08:35 AM
Hi Tauer,
Yes, a simple way is to add static routes for the /32 networks in addition to the /24 and then advertise them into BGP using the network command.
For example:
ip route 10.0.130.0 255.255.255.0 192.168.0.1
ip route 10.0.130.18 255.255.255.255 192.168.0.1
ip route 10.0.130.58 255.255.255.255 192.168.0.1
router bgp 100
network 10.0.130.18 mask 255.255.255.255
network 10.0.130.58 mask 255.255.255.255
Hope that helps
05-27-2016 09:28 AM
Hi Tauer,
you can use the Null 0 Routes from the advertise router.
and filter it by distribute list.
R1:
Static Routes:
ip route 10.0.130.18 255.255.255.255 null 0
ip route 10.0.130.58 255.255.255.255 null 0
ACL:
access-list 1 permit 10.0.130.18 0.0.0.0
access-list 1 permit 10.0.130.58 0.0.0.0
BGP:
router bgp 100
network 10.0.130.18 mask 255.255.255.255
network 10.0.130.58 mask 255.255.255.255
network 10.0.130.0 mask 255.255.255.0
neighbor R2 remote as x
neighbor R2 distribute-list 1 out
05-27-2016 09:39 AM
Thanks for the answer, but sorry, I forgot to mention... in this scenario, I can't use static routes.
In fact, I receive the prefix 10.0.130.0/24 via a routing protocol.
I'd like to advertise only 10.0.130.18/32 and 10.0.130.58/32 to R2
Sorry to describe the wrong scenario
05-27-2016 09:54 AM
You have to see the problem like this: BGP will not advertise something (network) that doesn't exist in your routing table. You need to have a specific subnet in your routing table, before it can be advertised through BGP.
05-27-2016 11:03 AM
Hi Yaron,
thanks for the answer.
Yes, I have this in mind... but I'm just trying to figure out if there's some workaround (wihtout using static routes)
I had no luck so far
05-28-2016 12:52 PM
What about a different approach. What you are describing to be is policy routing.
Why not just configure policy-routing on R2?
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide