cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
386
Views
0
Helpful
2
Replies

Reproducing route preference from as-path across iBGP distribution

Roland_Pope
Level 1
Level 1

I have inherited a BGP setup which involves a local BGP mesh consisting of 4 Routers at my site, all who are peered with each other (so each router has 3 iBGP peeerings with the other local routers).

Each of these routers has an eBGP peering with a single router at a remote site, where there are also 4 routers who have iBGP peerings with each other.

Now, my problem is this:

The received routes I am getting from the eBGP peers have an as-path prepending on them to control route preference, some have a single as-path, while others have several.

What i would like to be able to do is somehow preserve that route perference when I redistribute locally between my routers, but because as-path is lost and local routes are prefered, I end up in a situation where all of my routers prefer to send the external routes to each other instead of externally.

I can modify external routes with a higher local preference, but all that does is make each router prefer to route back directly to it external peer.

Can anyone offer a way for me to do the equivilent of  transfering the as-path to locally distributed routes?

2 Replies 2

Dennis Mink
VIP Alumni
VIP Alumni

Can you add bgp related config and a brief design of your set up.

Thanks




=============================
Please remember to rate useful posts, by clicking on the stars below. 

=============================

Please remember to rate useful posts, by clicking on the stars below.

Roland_Pope
Level 1
Level 1

Brief overview of the design is this:

We have two Datacenters with two routers at each site (so four routers) and we are using a Telco Mobile APN to get private Mobile traffic to servers inside these DC's.

The Telco also has two Datacentres, also with two routers at each site (also four routers).

On both the Telco side, and our customer side, we have the local routers fully meshed with iBGP.

Each router on our customer side has a single eBGP peering with a a single router on the Telco side.

The end game is to maximise availability so that we can lose a DC on either side, or router, and traffic will continue to flow.

In terms of routing, we have two private ranges, one in each DC, and the Telco also has two private ranges, one in each DC.

We are using as-path prepending to control our prefered location for our two ranges, and the Telco is doing the same.

BGP Config for one router below (One of the routers in our customer DC in LA), the other customer routers are configured pretty similar. The current modification of the local-prefix of routes learned from the telco I think is a fiddle to force routing to the telco ranges directly back to the telco peer when it is online, otherwise the iBGP routes learned from the other routers take priority, which causes issues.

router bgp 65100

bgp router-id 1.2.3.4

bgp log-neighbor-changes

network 192.168.128.0/24

redistribute connected

  ! Begin configuration for Texas Gateway1

neighbor 192.168.129.180 remote-as 65100

neighbor 192.168.129.180 soft-reconfiguration inbound

neighbor 192.168.129.180 description Texas Gateway1

neighbor 192.168.129.180 update-source 192.168.128.180

neighbor 192.168.129.180 next-hop-self

neighbor 192.168.129.180 route-map rm_peer_2_out out

  ! Begin configuration for Texas Gateway2

neighbor 192.168.129.254 remote-as 65100

neighbor 192.168.129.254 soft-reconfiguration inbound

neighbor 192.168.129.254 next-hop-self

neighbor 192.168.129.254 description Texas Gateway2

neighbor 192.168.129.254 update-source 192.168.128.180

neighbor 192.168.129.254 route-map rm_peer_2_out out

  ! Begin configuration for Los Angeles Gateway2

neighbor 192.168.128.254 remote-as 65100

neighbor 192.168.128.254 soft-reconfiguration inbound

neighbor 192.168.128.254 description Los Angeles Gateway2

neighbor 192.168.128.254 update-source 192.168.128.180

neighbor 192.168.128.254 next-hop-self

neighbor 192.168.128.254 route-map rm_peer_3_out out

! Begin configuration for Telco router 1

neighbor 4.3.2.1 remote-as 12345

neighbor 4.3.2.1 soft-reconfiguration inbound

neighbor 4.3.2.1 description Telco1

neighbor 4.3.2.1 ebgp-multihop

neighbor 4.3.2.1 next-hop-self

neighbor 4.3.2.1 update-source 1.2.3.4

neighbor 4.3.2.1 route-map rm_peer_1_in in

neighbor 4.3.2.1 route-map rm_peer_1_out out

!

# Telco: First we allow known networks inbound

ip prefix-list pl_peer_1_in seq 5 permit 10.160.0.0/16

ip prefix-list pl_peer_1_in seq 10 permit 10.192.0.0/16

# Then we deny everything else

ip prefix-list pl_peer_1_in seq 50 deny any

!

# Now we allow specific routes outbound

ip prefix-list pl_peer_1_128_out seq 5 permit 192.168.128.0/24

ip prefix-list pl_peer_1_129_out seq 10 permit 192.168.129.0/24

!

# Telogis Texas Data Center BGP Allow rules

ip prefix-list pl_peer_2_in seq 5 permit 10.160.0.0/16

ip prefix-list pl_peer_2_in seq 10 permit 10.192.0.0/16

ip prefix-list pl_peer_2_in seq 25 permit 192.168.129.0/24

# Then we deny everything else

ip prefix-list pl_peer_2_in seq 50 deny any

!

# Now we allow specific routes outbound

ip prefix-list pl_peer_2_out seq 5 permit 192.168.128.0/24

ip prefix-list pl_peer_2_out seq 15 permit 10.160.0.0/16

ip prefix-list pl_peer_2_out seq 20 permit 10.192.0.0/16

# Then we deny everything else

ip prefix-list pl_peer_2_out seq 50 deny any

!

# Telogis Los Angeles Data Center BGP Allow rules

ip prefix-list pl_peer_3_in seq 5 permit 10.160.0.0/16

ip prefix-list pl_peer_3_in seq 10 permit 10.192.0.0/16

ip prefix-list pl_peer_3_in seq 25 permit 192.168.128.0/24

# Then we deny everything else

ip prefix-list pl_peer_3_in seq 50 deny any

!

# Now we allow specific routes outbound

ip prefix-list pl_peer_3_out seq 10 permit 192.168.128.0/24

ip prefix-list pl_peer_3_out seq 15 permit 10.160.0.0/16

ip prefix-list pl_peer_3_out seq 20 permit 10.192.0.0/16

!

# Then we deny everything else

ip prefix-list pl_peer_3_out seq 50 deny any

!

route-map rm_peer_1_out permit 5

match ip address prefix-list pl_peer_1_128_out

set as-path prepend 65100

!

route-map rm_peer_1_out permit 10

match ip address prefix-list pl_peer_1_129_out

set as-path prepend 65100 65100 65100

!

route-map rm_peer_1_in permit 5

set local-preference 200

!

route-map rm_peer_2_out permit 5

match ip address prefix-list pl_peer_2_out

!

route-map rm_peer_3_out permit 5

match ip address prefix-list pl_peer_3_out

!

A cropped 'show ip bgp' on this router looks like this

BGP table version is 0, local router ID is 1.2.3.4

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

              r RIB-failure, S Stale, R Removed

Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path

*> 10.160.0.0/16    4.3.2.1                  0     200      0 20057 20057 20057 ?

* i                 192.168.129.254          0     100      0 ?

* i                 192.168.129.180          0     100      0 ?

* i                 192.168.128.254          0     100      0 ?

*> 10.192.0.0/16    4.3.2.1                  0     200      0 20057 ?

* i                 192.168.129.254          0     100      0 ?

* i                 192.168.129.180          0     100      0 ?

* i                 192.168.128.254          0     100      0 ?

*> 192.168.128.0/23 192.168.128.254          0         32768 ?

* i192.168.128.0    192.168.128.254          0     100      0 i

* i192.168.129.0    192.168.129.180          0     100      0 i

*>i                 192.168.129.254          0     100      0 i

Review Cisco Networking products for a $25 gift card