cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1428
Views
0
Helpful
10
Replies

Outbound BGP routing pref

We currently have dual routers with dual ISPs. We use AS_Path prepends to prefer one link over another inbound. I have seen the use of BGP communities to ensure the outbound uses the same path. We can't load balance because some applications we use do not "play well" when they are asynchronous. My question is which is best for outbound routing to use only one path?

Doug

10 Replies 10

rsimoni
Cisco Employee
Cisco Employee

Hi Doug,

local preference is the best option (iBGP between your routers is required).

second best is the use of weights on both routers (iBGP needed as well).

Riccardo

JohnTylerPearce
Level 7
Level 7

So is this a correct interrupration of your network topology?

(Internal Network)---->R1---->BGP---->ISP1

(Internal Network)---->R2---->BGP---->ISP2

Since you have applications that don't play well with asyncrhonous links, then how is your

default routing setup, since you have two different ISPs?

Depending on how your AS's are structured between the two ISPs, you could use the LOCAL_PREF

attribute.

We accept the default bgp route from each ISP. Your network topology is correct. We have our ASN and go to each ISP on their ASN. Check this config for my routers and see if you agree: R2 is my preferred path.

R1 ISP1

router bgp 10000

no synchronization

bgp log-neighbor-changes

network 1.1.1.0 mask 255.255.255.0

network 2.2.2.0 mask 255.255.255.0

timers bgp 5 15

neighbor 7.7.7.7 remote-as 50

neighbor 7.7.7.7 ebgp-multihop 255

neighbor 7.7.7.7 version 4

neighbor 7.7.7.7  soft-reconfiguration inbound

neighbor 7.7.7.7 route-map Verizon-INET out

ip as-path access-list 1 permit ^50$

access-list 10 permit 1.1.1.1.0 0.0.0.255

access-list 10 permit 2.2.2.2.0 0.0.0.255

route-map Verizon-INET permit 1

match ip address 10

set as-path prepend 10000 10000 10000

set local-pref 80

------------------------------------------------------------------------

R2- ISP 2

router bgp 10000

no synchronization

bgp log-neighbor-changes

network 1.1.1.0 mask 255.255.255.0

network 2.2.2.0 mask 255.255.255.0

timers bgp 5 15

neighbor 5.5.5.5 remote-as 75

neighbor 5.5.5.5 ebgp-multihop 255

neighbor 5.5.5.5 version 4

neighbor 5.5.5.5  soft-reconfiguration inbound

neighbor 5.5.5.5 route-map Verizon-INET out

ip as-path access-list 1 permit ^75$

access-list 10 permit 1.1.1.1.0 0.0.0.255

access-list 10 permit 2.2.2.2.0 0.0.0.255

route-map Verizon-INET permit 1

match ip address 10

set local-pref 150

We accept the default bgp route from each ISP. Your network topology is correct. We have our ASN and go to each ISP on their ASN. Check this config for my routers and see if you agree: R2 is my preferred path.

R1 ISP1

router bgp 10000

no synchronization

bgp log-neighbor-changes

network 1.1.1.0 mask 255.255.255.0

network 2.2.2.0 mask 255.255.255.0

timers bgp 5 15

neighbor 7.7.7.7 remote-as 50

neighbor 7.7.7.7 ebgp-multihop 255

neighbor 7.7.7.7 version 4

neighbor 7.7.7.7  soft-reconfiguration inbound

neighbor 7.7.7.7 route-map Verizon-INET out

ip as-path access-list 1 permit ^50$

access-list 10 permit 1.1.1.1.0 0.0.0.255

access-list 10 permit 2.2.2.2.0 0.0.0.255

route-map Verizon-INET permit 1

match ip address 10

set as-path prepend 10000 10000 10000

set local-pref 80

------------------------------------------------------------------------

R2- ISP 2

router bgp 10000

no synchronization

bgp log-neighbor-changes

network 1.1.1.0 mask 255.255.255.0

network 2.2.2.0 mask 255.255.255.0

timers bgp 5 15

neighbor 5.5.5.5 remote-as 75

neighbor 5.5.5.5 ebgp-multihop 255

neighbor 5.5.5.5 version 4

neighbor 5.5.5.5  soft-reconfiguration inbound

neighbor 5.5.5.5 route-map Verizon-INET out

ip as-path access-list 1 permit ^75$

access-list 10 permit 1.1.1.1.0 0.0.0.255

access-list 10 permit 2.2.2.2.0 0.0.0.255

route-map Verizon-INET permit 1

match ip address 10

set local-pref 150

Doug,

LP 150 is preferred over 80, that is true but....

1) You need to apply the route-map in ingress direction as LP is an attribute LOCAL to the AS (yours)

2) More important you miss the iBGP session between R1 and R2. Without that every router will take routing decision on its own, meaning that each of them will use its default towards its ISP link.

Riccardo

iBGP is on there currently, I just didn't add it to the example. So the route-map with both the prepends and the local-pref needs to be "in"?

well, no.

the prepend goes in outside direction (sorry I missed it earlier on) and the LP in ingress.

So you need 2 route-maps, i.e Verizon-INET-out with prepends and Verizon-INET-in with LP.

Riccardo

Ok. Thanks.

lgijssel
Level 9
Level 9

The first two attributes are weight and local_pref.

Personally I prefer the latter.

regards,

Leo

please rate and close the question after you test it out on your routers

Riccardo

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:

Review Cisco Networking products for a $25 gift card