BGP and static routes

Answered Question
Oct 29th, 2007

Hi all. I have 2 routers running BGP(they are in the same AS) but each one has a different ISP connected on him.

I'm trying to force the traffic going to some specific networks that are now going over one link to go out the other link.

I was thinking of putting static routes to these networks on the router I want the traffic go out.

But I was wondering should I distribute these static routes through iBGP to the other router or should I put static routes on the other router that will point to the router I want the traffic to go out?

Thanks for any advice.

I have this problem too.
0 votes
Correct Answer by saimbt about 9 years 1 month ago

Hi,

For outgoing traffic from your router u can use the Local Preference BGP attribute. It is the easiest to implement.

Use

Local preference for outgoing traffic

AS Prepend for incoming traffic

sample config:-

pri router

router bgp xyz

network abc

no synchronization

bgp log-neighbor-changes

neighbor remote-as

neighbor next-hop-self

neighbor

neighbor route-map 321 in

neighbor prefix-list 123 out

ip as-path access-list 1 permit ^pri-AS number$

route-map 321 permit 10

match as-path 1

set local-preference 200

Second router:-

router bgp

no synchronization

no bgp log-neighbor-changes

network

neighbor remote-as AS

neighbor route-map sec_link-Backup out

neighbor remote-as

neighbor fall-over

neighbor next-hop-self

no auto-summary

route-map sec_link-Backup permit 10

match ip address prefix-list yourcompany

set as-path prepend

ip prefix-list yourcompany seq 5 permit

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (2 ratings)
Loading.
Jon Marshall Mon, 10/29/2007 - 05:16

Hi Igor

if you are running IGBP between your 2 routers then you should look to use local preference within your AS which will prefer one exit point over another per route but will still fall back to the other exit point if a link goes down. See attached doc for explanation of local preference.

http://www.cisco.com/en/US/tech/tk1330/tsd_technology_support_technical_reference_chapter09186a00807597c7.html#wp1020583

if you are not running IBGP between your 2 routers you could use static routes but i don't think this is as clean or flexible.

HTH

Jon

Correct Answer
saimbt Mon, 10/29/2007 - 05:28

Hi,

For outgoing traffic from your router u can use the Local Preference BGP attribute. It is the easiest to implement.

Use

Local preference for outgoing traffic

AS Prepend for incoming traffic

sample config:-

pri router

router bgp xyz

network abc

no synchronization

bgp log-neighbor-changes

neighbor remote-as

neighbor next-hop-self

neighbor

neighbor route-map 321 in

neighbor prefix-list 123 out

ip as-path access-list 1 permit ^pri-AS number$

route-map 321 permit 10

match as-path 1

set local-preference 200

Second router:-

router bgp

no synchronization

no bgp log-neighbor-changes

network

neighbor remote-as AS

neighbor route-map sec_link-Backup out

neighbor remote-as

neighbor fall-over

neighbor next-hop-self

no auto-summary

route-map sec_link-Backup permit 10

match ip address prefix-list yourcompany

set as-path prepend

ip prefix-list yourcompany seq 5 permit

IgorHamzic Tue, 11/13/2007 - 00:46

Thanks for your great advice guys. Did something similar to your suggestions and works fine.

Actions

This Discussion