08-06-2009 06:31 PM - edited 03-04-2019 05:40 AM
I'm sorry if this is kind of long. I'm sure there's a simple answer. Hoping someone can shed some light:
Let's say the âmajorâ network for my site is 10.11.0.0 /16
Let's say I had an interface that I sub'd out into 3 vlans. (gig1/0 sub'd into g1/0.10, g1/0.20 & g1/0.30)
Networks are
vlan 10 = 10.11.0.0 /24
vlan 20 = 10.11.1.0 /24
vlan 30 = 10.11.2.0 /24
I have 2 different bgp peers I want to advertise networks to.
One peer I want to advertise the whole 10.11.0.0 /16. The other peer I only want to advertise 10.11.2.0 /24.
Regarding the peer that I wanted to advertise 10.11.0.0 /16, I noticed that I couldn't just put "network 10.11.0.0 mask 255.255.0.0" under my ârouter bgpâ section of the config. I didn't have any loopback interfaces with any 10.11.0.0 /16 IP's assigned to them. Nor did I have âredistribute connectedâ within my ârouter bgpâ section of the config.
So I generated the router by adding a static route to Null 0. (ip route 10.11.0.0 255.255.0.0 null 0) then I added the command âredistribute staticâ under the ârouter bgpâ portion of the config. By doing this, I was able to generate the 10.11.0.0 /16 route. (NOTE, I haven't or didn't need to add the ânetwork 10.11.0.0 mask 255.255.0.0â statement under the ârouter bgp portion of my config.)
So now I am sending my 10.11.0.0 /16 route to the peer accepting my 10.11.0.0 /16 advertisement.
I want to send ONLY the 10.11.2.0 /24 to my other peer.
I was able to do this by simply adding the statement âredistribute connectedâ under the ârouter bgpâ portion of my config. (Easy enough) BUT my question isâ¦..is there a way to advertise my 10.11.2.0 /24 to the peer who wants to see it, without using the âredistribute connectedâ command?
And secondly, if I were to add the network statement under my ârouter bgpâ for the 10.11.0.0 /16, could I also add the 10.11.2.0 /24 network statement under router bgp? (And removing the redistribute connected statement.)
Is there a way to advertise routes to different BGP peers without using redistribute static and/or redistribute connected?
So it would look like
Router bgp 65425
network 10.11.0.0 mask 255.255.0.0
network 10.11.2.0 mask 255.255.255.0
Your input is greatly appreciated
Solved! Go to Solution.
08-06-2009 07:03 PM
Hi Jesse,
BGP is a very special protocol, routes need to be exist in the routing table, via IGP, connected, static, before it can advertise into BGP.
So your solution of advertising 10.11.0.0/16 into the BGP by adding a static route with the command ip route 10.11.0.0 255.255.0.0 null0 is one way to do it.
Regards,
jerry
08-06-2009 06:48 PM
Hi Jesse,
You can use prefix-list under your neighbor command to control what to advertise to each of the BGP neighbor. For example
router bgp 65425
network 10.11.0.0 mask 255.255.0.0
network 10.11.2.0 mask 255.255.255.0
neighbor a.b.c.d remote-as aaaa
neighbor a.b.c.d prefix-list SLASH16 out
neighbor w.x.y.z remote-as wwww
neighbor w.x.y.z prefix-list SLASH24 out
!
ip prefix-list SLASH16 permit 10.11.0.0/16
ip prefix-list SLASH24 permit 10.11.2.0/24
HTH,
jerry
08-06-2009 06:57 PM
Hi Jerry, thank you for taking the time to reply.
My understanding of pre-fix lists, is that they are for controlling what routes are allowed to be advertised and what routes are not. (filter)
With regards to the example in your reply, I see that you have listed the networks 10.11.0.0 /16 and 10.11.2.0 /24 as "network" statements withing BGP but, without having a static route and redistributing it into BGP (and/or) redistributing "connected" into BGP, how are you / how would you be generating the routes?
(I hope I'm making sense.)
Thanks again.
Jesse
08-06-2009 07:03 PM
Hi Jesse,
BGP is a very special protocol, routes need to be exist in the routing table, via IGP, connected, static, before it can advertise into BGP.
So your solution of advertising 10.11.0.0/16 into the BGP by adding a static route with the command ip route 10.11.0.0 255.255.0.0 null0 is one way to do it.
Regards,
jerry
08-06-2009 07:13 PM
Jerry,
Thank you very much!
Jesse
08-06-2009 07:14 PM
You are welcome Jesse.
Regards,
jerry
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