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

Unanswered Question
Mar 5th, 2009

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

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (11 ratings)
Loading.
Edison Ortiz Thu, 03/05/2009 - 16:19

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.

Jon Marshall Thu, 03/05/2009 - 16:20

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

Edison Ortiz Thu, 03/05/2009 - 16:21

Jon,

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

__

Edison.

Jon Marshall Thu, 03/05/2009 - 16:43

"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

wilson_1234_2 Thu, 03/05/2009 - 16:43

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?

Jon Marshall Thu, 03/05/2009 - 16:49

"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

wilson_1234_2 Thu, 03/05/2009 - 16:56

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?

Edison Ortiz Thu, 03/05/2009 - 17:06

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.

Jon Marshall Thu, 03/05/2009 - 17:11

"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

Edison Ortiz Thu, 03/05/2009 - 17:16

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

wilson_1234_2 Thu, 03/05/2009 - 17:34

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.

Jon Marshall Thu, 03/05/2009 - 17:38

"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 can but as i say it doesn't make a lot of difference in your scenario as long as you use the example Edison gave ie. network 10.1.1.0 mask 255.255.255.0.

If you used any of your other subnets under the BGP config instead then yes it could make a difference.

But as i say if 10.1.1.0/24 is lost then you can't get to the switch subnets anyway from outside so it doesn't make much difference. If in the future though you end up with redundancy in the branch with more than one path to the L3 switch then yes running an IGP like OSPF between the L3 switch and router(s) would make sense.

Jon

wilson_1234_2 Thu, 03/05/2009 - 17:49

I was just thinking about this,

couldn't I have solved the problem if I had just put a static route in the router.

For example, if my link to the switch is

Router Switch

10.1.1.1/30 --> 10.1.1.2/30

Put a static route in the router:

10.1.0.0 255.255.0.0 10.1.1.2

Edison Ortiz Thu, 03/05/2009 - 18:25

Yes, with a static route will solve the issue without having an aggregate.

It's actually a perfect solution

1) You instruct the router about the other subnets in the switch

2) It allows you to enter the network 10.1.0.0 mask 255.255.0.0 under BGP.

Good job Richard :)

Remember to have a default route configured on the switch pointing to the router LAN interface.

wilson_1234_2 Fri, 03/06/2009 - 04:33

thanks jon and edison,

you guys mentioned the static route first.

thanks for all of the help.

Actions

This Discussion