cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
445
Views
0
Helpful
5
Replies

BGP Route Advertisement Question

mortonjes
Level 1
Level 1

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

1 Accepted Solution

Accepted Solutions

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

View solution in original post

5 Replies 5

Jerry Ye
Cisco Employee
Cisco Employee

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

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

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

Jerry,

Thank you very much!

Jesse

You are welcome Jesse.

Regards,

jerry

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: