cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
410
Views
5
Helpful
3
Replies

BGP and static routes

IgorHamzic
Level 1
Level 1

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.

1 Accepted Solution

Accepted Solutions

saimbt
Level 1
Level 1

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

View solution in original post

3 Replies 3

Jon Marshall
Hall of Fame
Hall of Fame

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

saimbt
Level 1
Level 1

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

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

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: