Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

BGP question - prepending

I have a question about BGP pre-pending that I am hoping someone might be able to help with...

I have an internet connection to an ISP A (single homed) where we advertise multiple Class C networks.

At the same location I also have another internet connection to ISP B which we use primarily for our corporate internet browsing. We currently advertise 1 x Class C block out via ISP B.

I would like to advertise a second Class C network out via ISP B - this particular network is currently advertised via ISP A so I would like to make this a back up route via ISP B, if there is an outage of the connection to ISP A.

Can I do this using BGP pre-pending? I have played around with a few configurations but I seem to be having a few problems getting this working as I seem to break the corporate browsing.

My understanding of BGP is a bit limited, ISP B is not filtering our networks so they have advised that I can advertise an additional network(s).

Can someone have a look at my configuration and advise if they can see anything wrong or perhaps suggest a better way of doing this.

A sample configuration would be very much appreciated. 

!
access-list 1 permit x.x.13.0  - Class C block - Corporate internet browsing etc
access-list 2 permit x.x.22.0  - Second class C block - I would like to advertise this network via ISP B as a back up route if my primary internet fails
!
route-map test-prepend permit 10
match ip address 2
set as-path prepend 55555 55555 55555
continue 20       
route-map test-prepend permit 20
match ip address 1
!
router bgp xxxxx
network x.x.13.0 mask 255.255.255.0
network x.x.22.0 mask 255.255.255.0
neighbor x.x.x.105 remote-as xxxx
neighbor x.x.x.105 route-map test-prepend out

!

Everyone's tags (1)
7 REPLIES
Silver

BGP question - prepending

Hi,

Do you have a diagram of your topology, it helps to clarify things, from what you are posting I didn't quite understood your topology

1. First of all, BGP follows a path-selection algorithm:

1.1. weight

1.2. lpref

1.3. localy-originated

1.4. as-path

1.5. origin-code

1.6. MED

1.7. eBGP over iBGP

1.8. Next-hop best metric

1.9......This should be more than enough

2. If you have a public AS and a public prefix (a /24 for instance) if you inject this prefix in AS #1 prepending you AS several times, this would make all upstream ISP's prefer the PATH over ISP#2

2.1. Be aware that inside ISP#1 Lpref comes first that AS-PATH, but if everything is by default it would prefer ISP#2

3. Keep in mind that with prepending you area only hinting the upstream ISP for the path they should flow for returning to your prefix, you are not hinting the way o move out of your network, that is controlled by LPREF

4. One final warning, be careful with your testing in the public network, if you make several changes/tests...your prefixes could be dampened.....and you could loose conectivity

---

Posted by WebUser Bruno Fernandes from Cisco Support Community App

New Member

Re: BGP question - prepending

Hi,

Thanks for your prompt response.

I understand what you are saying and I also understand using Local preference to influence how traffic exits my network.

We are using a registered AS number and a public prefix /24.

As you correctly point out I am just trying to influence the incoming route by pre-pending the x.x.22.0 network out via ISP B.

Ideally, I want the incoming route path for the x.x.22.0 to always use ISP A, if that network is available. If the connection to ISP A is down then I would like for the prepended route x.x.22.0 to be learnt as an alternate path via ISP B. This is how I want it to work as per your point number 2.

The essence of my question relates more to the configuration I posted. I wanted to apply prepending to x.x.22.0 and not prepend x.x.13.0 (the original network advertised by ISP B). The x.x.13.0 network is not advertised out via ISP A, so there is only one path for this traffic to take.

When I applied the above config in my original post I seemed to break my internet browsing and only restored that after removing the "neighbor x.x.x.105 route-map test-prepend out" from the BGP process.

thanks, Peter

Hall of Fame Super Silver

BGP question - prepending

Peter

Here are a couple of comments about your config which I hope will be helpful:

- I question why you have a continue 20 in your first route map instance. If it matched access list 2 why would you then send it on to see if it would match access list 1?

- your post has the prepend value as 55555. Is that your AS number? What you try to prepend needs to be exactly your AS number.

- I am not sure why this config would break corporate browsing. But if it does then I would suggest changing the order of the instances of the route map and match access list 1 in the first instance and then match access list 2 and set the prepend in the second instance.

HTH

Rick

New Member

Re: BGP question - prepending

Hi Rick,

thanks for your suggestions, Ill give that a try.

No the AS number in my example config is not our real AS number.

Peter. 

Hall of Fame Super Silver

BGP question - prepending

Peter

Just be sure that the value that you use in the configuration of your router for prepend is the AS number exactly.

HTH

Rick

New Member

Re: BGP question - prepending

Hi Rick,

I tried changing the route-map around but still no joy. I matched the AS number exactly so that isn't the problem, I am familiar with prepending as I have another multihomed internet connection at a remote datacentre.

I am using the x.x.13.0/24 network for corporate browsing but after I apply the route-map to the bgp neighbour I then do a clear ip bgp x.x.x.105 soft out I then am not able to connect to any websites.

router bgp xxxxx
neighbor x.x.x.105 route-map test-prepend out

clear ip bgp x.x.x.105 soft out

As soon as I remove the router bgp, neighbor x.x.x.105 route-map test-prepend out and do another clear ip bgp x.x.x.105 soft out the browsing works again.

What I really wanted to do was...

Pre-pend the x.x.22.0/24 network - so that it any incoming traffic to this network only uses ISP B when the connection to ISP A (connected to a different router) is down.

Not prepend the x.x.13.0/24 network which is only available via ISP B (this is not advertised at all via ISP A).

I have tried playing around with the route-map a bit and removing reference to the x.x.13.0/24 (match ip address 1 (access-list 1 permit x.x.13.0 ).

It seems that the route-map when applied to the bgp neighbor is having some undesirable and un-expected behaviour.

Peter.  

Hall of Fame Super Silver

BGP question - prepending

Peter

I am not clear why it would be having this effect. Perhaps if you post a current copy of the BGP configuration, the route map, and the access lists we might gain some insight into the problem.

HTH

Rick

2166
Views
0
Helpful
7
Replies