cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2764
Views
55
Helpful
19
Replies

BGP config to advertise 16 bit subnet, for 24 bit subnets

wilson_1234_2
Level 3
Level 3

I have a remote branch that is connected to my Main site via BGP.

The BGP is up and active.

I was unable to avertise a 16 bit subnet to the main branch for my 24 bit VLAN addresses that have been created.

I had the below config at first and the router did not advertise my subnet to the main branch until I changed the mask on the router interface to a 16 bit subnet (10.1.0.0).

The goal is to advrtise a 16 bit subnet so I don't have every route from the remote branch in the main branch route table and I can communicate with all subnets.

Can this be done?

Router

interface FastEthernet0/0

description Link to switch

ip address 10.1.1.1 255.255.255.0

!

router bgp 65004

no synchronization

bgp log-neighbor-changes

network 10.1.0.0 mask 255.255.0.0

network 172.16.254.1 mask 255.255.255.255

network 1.2.1.52 mask 255.255.255.252

neighbor 1.2.1.53 remote-as 65000

neighbor 1.2.1.53 version 4

neighbor 1.2.1.53 soft-reconfiguration inbound

no auto-summary

Switch

VLan 1

10.1.1.2 255.255.255.0

Vlan 2

10.1.10.1 255.255.255.0

Vlan 3

10.1.100.1 255.255.255.0

Vlan 4

10.1.200.1 255.255.255.0

19 Replies 19

Edison Ortiz
Hall of Fame
Hall of Fame

Hi Richard,

Not sure how the advertisement for 10.1.0.0/16 is taking place.

With BGP, in order to advertise a route, the route must be in the routing table and it must be an exact match.

You don't have 10.1.0.0/16 in the routing table unless you've created a static route with such information.

If you want to advertise a summary of all the networks as 10.1.0.0/16 you must do as follow:

router bgp 65004

network 10.1.1.0 mask 255.255.255.0

aggregate-address 10.1.0.0 255.255.0.0 summary-only

HTH,

__

Edison.

Well at least we agreed :-)

Not so fast :)

See my other reply.

Jon Marshall
Hall of Fame
Hall of Fame

Richard

Just to clarify - you want to advertise a /16 for the multiple /24's you have in each site ?

If so the issue you have is that EBGP must have a match in the IGP routing table and it doesn't ie. there is no route for 10.1.0.0 255.255.0.0.

So i would recommend using an aggregate address ie. under your BGP config

router bgp 65004

aggregate-address 10.1.0.0 255.255.0.0 summary-only

As long as the router has at least one route in it's routing table that falls under that summary range it will advertise it out.

Jon

Jon,

You need to advertise the network into BGP in order to aggregate it.

__

Edison.

Oops, so we didn't agree !. Thanks Edison.

"You need to advertise the network into BGP in order to aggregate it"

Just to clarify, for myself, the above means you need to advertise at least one network that falls into the range ?

The other issue i see with this, altho it doesn't really affect Richard's example is that if 10.1.1.0/24 was lost from the routing table so would the summary address so all the other networks would be lost too.

Now in Richard's case it doesn't matter as 10.1.1.x is the subnet that connects the router to the L3 switch in the branch. But with 2 paths from the router it could.

Would it not make more sense in the general example to run an IGP on the router and redistribute into BGP but only advertise the summary out ?

Jon

Thanks guys.

Is the fact the the route is being avertised properly when I change the subnet mask on the Ethernet interface to 16 bit, due to the fact the the route is in the route table of the router as a connected route once changed?

Also, what about the "no auto summary" in the BGP config?

"Is the fact the the route is being avertised properly when I change the subnet mask on the Ethernet interface to 16 bit, due to the fact the the route is in the route table of the router as a connected route once changed?"

Exactly.

"Also, what about the "no auto summary" in the BGP config?"

this turns off automatic summarisation but will not affect your aggregate address statement.

Jon

Thanks jon and edison.

I wondered about this jon:

"Would it not make more sense in the general example to run an IGP on the router and redistribute into BGP but only advertise the summary out ? "

I have an image on the 3560 that I could configure ospf between the switch and router, if I do that would you suggest distributing all routes into BGP?

You don't need to run an IGP on this scenario as your routes are connected routes (unless I'm missing something).

You can, however, redistribute connected into BGP and advertised the summary of it.

router bgp 65004

redistribute connected route-map CONNECTED-TO-BGP

aggregate-address 10.1.0.0 255.255.0.0 summary-only

route-map CONNECTED-TO-BGP

match interface f0/0

If the routes aren't directly connected routes, then Yes - you need an IGP and redistribute that IGP into BGP + aggregate it.

HTH,

__

Edison.

"You don't need to run an IGP on this scenario as your routes are connected routes (unless I'm missing something)."

Not sure they are. The 10.1.1.0/24 is connected but the other subnets are routed on the L3 switch as far as i can tell.

Jon

Well, I was missing something :)

Saw the post again and the switch and router are 2 different devices.

I'm assuming he has a static route on the router and switch for routing to function unless, again, I'm missing something else :)

I was going to have a vlan for the router to switch connection, and have a vlan for each of the workstations, servers, printers which are all on the switch.

Review Cisco Networking for a $25 gift card