cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1173
Views
13
Helpful
19
Replies

injecting 2 defaut routes

san-pandey
Level 1
Level 1

Hi all, In a MPLS network can you inject two 'default-originate' one from site A (primary site) and the other with higher metric from sie B (back up site)?

router bgp 65001

no synchronization

neighbor 172.16.11.1 remote-as 111 (MPLS service provider)

neighbor 172.16.11.1 next-hop-self

neighbor 172.16.1.1 default-originate route-map Metric CHANGE

route-map Metric CHANGE permit 10

set metric 200

san

1 Accepted Solution

Accepted Solutions

San, in your case since there are 2 different AS's, the SP will have to enable "bgp always compare med" for the metric to be compared for routes with different first AS's, which is not really a good idea and he wont agree to do so as well.

So you will have to go with the AS path prepend or configure same AS on both sides ( this will again require intervention from the service provider to allow and override same AS routes for routes exchange between both primary and secondary sites)

So without intervention from the SP and to have your own control, you would have to go with the AS Path prepending in your particular case.

HTH-Cheers,

Swaroop

View solution in original post

19 Replies 19

mohammedmahmoud
Level 11
Level 11

Hi San,

Yes it is doable, and here you are my recommendation, use a network command for 0.0.0.0 at both the primary and the backup sites (when using a network statement there is no need for default-information originate), and on the primary site set the local-pref of the advertised default route to be more than 100 and thus it will be preferred over the other one (with a default local-pref of 100) on the the routers receiving both.

NOTE You must make sure the default route is present in the routing table of the primary router (most commonly with a static default route to null0 interface, accordingly any destination address that cannot be matched to a more-specific route matches the static route and is dropped).

I hope that i've been informative.

HTH,

Mohammed Mahmoud.

Hi Mohammed,

I did not know that you can use local-preference to infuluence route from two different sites. or did I read your posting wrongly? I always though that you can only tag local-perference for incoming routes only. Can you post a sample config please?

Thanks,

San

San,

You can influence the local preference of the advertised routes on the primary router before being advertised to other routers in the AS:

On the primary router Router1:

network 0.0.0.0

neighbor x.x.x.x route-map default-route out

access-list 1 permit 0.0.0.0

route-map default-route permit 10

match ip address 1

set local-preference 110

!

On the other router you'll have the default route received and manipulated:

Router2#sh ip bgp | i 0.0.0.0

*> i0.0.0.0 y.y.y.y 0 110 0 i

HTH,

Mohammed Mahmoud.

Hi Mohammed,

Perhaps a diagram will clarify what i am trying to achieve. In the diagram, I am trying to inject default route from site A and site B, into MPLS service privider. So that the internet traffic from site c is preferred through site A. SInce, i am advertising to a different AS, i think the local-perference will not have any impact.

I am also getting a default route from my ISP AS 1 through BGP. I intend to run iBGP between CE3 and CE1.

thanks,

san

San, since you want to control the default route injection from the customer side, and not from the service provider side, you can do a AS Path Prepend to the deafult route while advertising it into the MPLS cloud.

Advertise a longer AS path for the default which you want to be preferred as the secondary path compared to the primary default route AS Path

Sample Config:

!

host CE2

!

router bgp 65001

neighbor route-map DEFAULT out

!

!

route-map DEFAULT permit 10

match ip address prefix-list DEFAULT

set as-path prepend 100 100

!

route-map DEFAULT permit 20

!

ip prefix-list DEFAULT seq 5 permit 0.0.0.0/0

!

or

!

router bgp 65001

neighbor default originate route-map DEFAULT1

!

!

route-map DEFAULT1 permit 10

set as-path prepend 100 100

!

If you were the service provider, the PE connecting to site C would prefer the default from the closest IGP next hop. But that can be modified as specified by Mohammed using Local Preference. So that the PE connecting to site C uses only the default to your primary site which would be based on the Local Preference as manipulated.

HTH-Cheers,

Swaroop

And metric cannot be used as at the secondary site you are originating the default your self, so definately the AS path would be shorter and AS path is check first before Metric hence secondary site would be preferred as the primary default route.

(this is considering that both the sites are equal cost next hops from the PE connecting to the site C)

HTH-Cheers,

Swaroop

Swaroop, Thanks for the reply. I will use the AS path from the CE router. Now, I understand what Mohammed was trying to say with the local-perference from the PE. Normally, we do not like to influence routes from the PE. Doing from the CE gives more control to the customers.

I am still wondering why changing metric is not recommended. Just for understanding purpose, in this scenario, manapulating metric from site B, does not do it? Can you help me understand this?

Thanks,

san

San, as per the BGP path selection first weight is considered if this is equal, then Local Preference is considered if this is also equal, then the prefix which was originated locally is considered, if none of the in tie prefixes are locally originated then AS path Length is considered, if AS path length is also equal then MED (Metric) is considered.

Hence whatever the metric is, irrespective of that the shorter AS Path route is installed.

In your case for the path selection from the 3rd PE which connects to the site C, weight and local preference would be left to default as there is no manipulation from within the MPLS BGP. So both defaults would have same weight and local preference, now next comes local origination, thats not applicable, and then next comes AS path. Now if you see what happens is since you are advertising the default yourself from the secondary site, the AS path for that default would be 1 path long (only your AS), but in case of primary it would be 2 paths long(upstream AS and your AS) as you are just propogating the default received from your upstream AS. Hence the secondary site default is considered.

If you want to use MED(Metric) then what you can do is do a default-originate from both primary and secondary sites towards the MPLS PE's. And then the Metric manipulation would work.

HTH-Cheers,

Swaroop

For Reference BGP Path Selection Algorithm:

http://www.cisco.com/warp/public/459/25.shtml

Swaroop, Now i understand why AS path is a better option. Thanks for your help.

Now for future understanding, let us say that the AS path is equal from both sites. For MED, does it still work, if I have different AS at the primary and secondary site, as in my diagram? I am a bit confused from the link:

'This comparison only occurs if the first (the neighboring) AS is the same in the two paths. Any confederation sub-ASs are ignored.

In other words, MEDs are compared only if the first AS in the AS_SEQUENCE is the same for multiple paths. Any preceding AS_CONFED_SEQUENCE is ignored'

thanks,

san

San, in your case since there are 2 different AS's, the SP will have to enable "bgp always compare med" for the metric to be compared for routes with different first AS's, which is not really a good idea and he wont agree to do so as well.

So you will have to go with the AS path prepend or configure same AS on both sides ( this will again require intervention from the service provider to allow and override same AS routes for routes exchange between both primary and secondary sites)

So without intervention from the SP and to have your own control, you would have to go with the AS Path prepending in your particular case.

HTH-Cheers,

Swaroop

Hi San,

I am very glade that you've got it all sorted now, and Swaroop it was really a nice analysis from your side.

HTH,

Mohammed Mahmoud.

Both Swaroop and Mohammed, thanks for your help.

San

Hi Swaroop, I hope it is ok to use a previous post to ask further.

If two default routes are advertised by two sites (site a and site b) into MPLS network.

The PE at site c receives two routes from MP-BGP, does the PE then advertise both routes to site c CE or does it send out the best route only, so that CE at site c only see the best route.

thanks,

san

San, its only one route from the PE to CE with the PE itself as the nexthop on the PE-CE EBGP connection.

If there are 2 links to the CE form the PE, the same route would be sent on both the links to the CE with itself as the next-hop.

HTH-Cheers,

Swaroop

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: