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)
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
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.