OSPF - how to prefer an E2 route over an IA?

Answered Question
Jun 18th, 2010
User Badges:

I am writing a new config for our sites.


Basically we have main lines and backup lines. We run BGP through the main lines and OSPF over the backup lines, the BGP is redistributed into OSPF at the main line router for each site, and that OSPF runs between the main line router, the backup line router, and the core layer 3 switch on each site.


Now the problem is that, due to the redistribution, the main line route to a particular site becomes an E2, and the backup route to the same site is an IA, which goes into the routing table.


How can I engineer to have the E2 route preferred over the IA route? Is it even possible?


Thanks for reading

Correct Answer by Giuseppe Larosa about 6 years 10 months ago

Hello Charles,

you can only prefer an O E2 route over another O E2 route for its lower metric.


in your scenario you need to use a second OSPF process on the backup lines and to redistribute carefully among the two OSPF processes.


In this way you can make routes comparable = of the same type and those coming from BGP primary links preferred for their lower metric


Hope to help

Giuseppe

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
Correct Answer
Giuseppe Larosa Fri, 06/18/2010 - 10:11
User Badges:
  • Super Silver, 17500 points or more
  • Hall of Fame,

    Founding Member

Hello Charles,

you can only prefer an O E2 route over another O E2 route for its lower metric.


in your scenario you need to use a second OSPF process on the backup lines and to redistribute carefully among the two OSPF processes.


In this way you can make routes comparable = of the same type and those coming from BGP primary links preferred for their lower metric


Hope to help

Giuseppe

TODD RIEMENSCHNEIDER Fri, 06/18/2010 - 11:42
User Badges:

Is there a way you could adveritise the route in BGP so that it's more specific than the route learned by the OSPF inter area route? That way it would chose route specificity over OSPF route type.


-Todd

TODD RIEMENSCHNEIDER Fri, 06/18/2010 - 11:43
User Badges:

Is there a way you could  adveritise the route in BGP so that it's more specific than the route  learned by the OSPF inter area route? That way it would chose route  specificity over OSPF route type.


-Todd

gatlin007 Fri, 06/18/2010 - 11:54
User Badges:
  • Silver, 250 points or more

There is another alternative; although it doesn’t scale well.  Use the distance command under OSPF to lower the admin distance to something below 110 for only that particular OSPF E2 route.

Chris

TODD RIEMENSCHNEIDER Fri, 06/18/2010 - 11:58
User Badges:

An example to which I am referring would be if the route is a 192.168.0.0/23, you could add two static routes on the BGP router pointed to the correct next hop. The routes being 192.168.0.0/24 and 192.168.1.0/24 then add the network commands to advertise them in BGP across the appropriate link to the remote location. The when they get redistributed you have 2 /24s E2 that would be preferred over the ospf /23 IA network. The key to this being that you could add the statics and advertise them in the BGP router without influencing the ospf that send the routes over the backup link. Obviously if ospf started advertising those routes as IA routes it wont work.


-Todd

gatlin007 Sat, 06/19/2010 - 09:37
User Badges:
  • Silver, 250 points or more

Something you could do to cause both routes to occur as external is disable OSPF on the remote core switch for that network, and then redistribute that connected network into OSPF. This would cause both routes for the prefix in question to be external; consequently easier to deal with.

For example if 192.168.1.0/24 is the network that’s being preferred over the backup circuit and your OSPF config at the remote site looks something like this:

Router ospf 10
Network 192.168.1.0 0.0.0.255 area 0
Exit


Then try this:

Ip prefix-list conn2ospf permit 192.168.1.0/24

Route-map conn2ospf permit 10
Match address prefix-list conn2ospf
Exit

Router ospf 10
No network 192.168.1.0 0.0.0.255 area 0
Redistribute connected subnets metric-type 1 route-map conn2ospf
Exit


Also alter how you redistribute the BGP routes into OSPF to be type 1 external routes; this will allow the metric to increase on an external route as it’s propagated throughout the OSPF domain.  Because you are closer to your BGP router it will look probably look better than the E1 route over the backup circuit.  If not the metrics of the routes can be adjusted.

After this 192.168.1.0/24 should occur as an E1 via both circuits.

This is a great document:

http://www.cisco.com/en/US/tech/tk365/technologies_white_paper09186a0080094e9e.shtml#t33


Chris

Giuseppe Larosa Thu, 09/23/2010 - 14:01
User Badges:
  • Super Silver, 17500 points or more
  • Hall of Fame,

    Founding Member

Hello Mauricio,

the original poster is a customer of an MPLS L3 VPN service with direct backup links that are backdoors.


I agree that a possible option could be moving to OSPF as PE-CE protocol to avoid to have O E2 routes and then with OSPF sham link is possible to have comparable O routes when compared with the backdoor links provided by backup links


However, all this has to be done on service provider side and it is not an option for the customer side.


In other words the customer should ask for :

moving to OSPF as PE-CE protocol

for a sham-link between PE nodes


Hope to help

Giuseppe

Charles Rayer Fri, 09/24/2010 - 06:11
User Badges:

We did originally have sham links with the provider but every time they did maintenance we got 2 hours of downtime as opposed to 5-10 minutes for the BGP only links so we decided that BGP native was the only way to go....


Cheers,

Mohamed Mehenoun Tue, 01/31/2017 - 08:05
User Badges:

You can try to use a higher prefix to prefer the route i.e. the router will consider them as two different routes and take the highest prefix.

A router evaluates routes in the following order.

  1. Prefix Length - The longest-matching route is preferred first. Prefix length trumps all other route attributes.
  2. Administrative Distance - In the event there are multiple routes to a destination with the same prefix length, the route learned by the protocol with the lowest administrative distance is preferred.
  3. Metric - In the event there are multiple routes learned by the same protocol with same prefix length, the route with the lowest metric is preferred. (If two or more of these routes have equal metrics, load balancing across them may occur.)

http://packetlife.net/blog/2010/aug/16/route-preference/


Actions

This Discussion