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

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
Cisco Employee

Re: Outbound BGP routing pref

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

Outbound BGP routing pref

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.

Community Member

Outbound BGP routing pref

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

Community Member

Re: Outbound BGP routing pref

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

Cisco Employee

Outbound BGP routing pref

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

Community Member

Re: Outbound BGP routing pref

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"?

Cisco Employee

Outbound BGP routing pref

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

Community Member

Re: Outbound BGP routing pref

Ok. Thanks.

Outbound BGP routing pref

The first two attributes are weight and local_pref.

Personally I prefer the latter.

regards,

Leo

Cisco Employee

Outbound BGP routing pref

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

Riccardo

322
Views
0
Helpful
10
Replies
CreatePlease to create content