Outbound BGP routing pref

Unanswered Question
Jan 12th, 2012
User Badges:

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

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
JohnTylerPearce Thu, 01/12/2012 - 08:00
User Badges:
  • Silver, 250 points or more

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.

Douglas Bradfield Thu, 01/12/2012 - 08:14
User Badges:

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

Douglas Bradfield Thu, 01/12/2012 - 08:17
User Badges:

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

rsimoni Thu, 01/12/2012 - 08:33
User Badges:
  • Cisco Employee,

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

Douglas Bradfield Thu, 01/12/2012 - 08:39
User Badges:

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

rsimoni Thu, 01/12/2012 - 08:45
User Badges:
  • Cisco Employee,

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

rsimoni Thu, 01/12/2012 - 07:56
User Badges:
  • 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

lgijssel Thu, 01/12/2012 - 08:47
User Badges:
  • Red, 2250 points or more

The first two attributes are weight and local_pref.

Personally I prefer the latter.


regards,

Leo

rsimoni Thu, 01/12/2012 - 09:16
User Badges:
  • Cisco Employee,

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


Riccardo

Actions

This Discussion