Comware Based
1747980 Members
4495 Online
108756 Solutions
New Discussion

Static Route Preferred over OSPF learned route

 
larrymac
Frequent Advisor

Static Route Preferred over OSPF learned route

Hi All,

I want to force all traffic down a specific route.  My network is 4 sites connected via WAN. 

We use OSPF to advertise routes.  In the routing table all my company networks are listed as O_ASE  150  18 

I have a default route 0.0.0.0/0   STATIC   60   0 

My understanding is that if there is no specific route (OSPF Learned) in the routing table it will look to this default route?

But can I add in a default route to push all traffic out this interface rather than what is learned from OSPF?

Can I temporarily disable OSPF?  (If I use undo command I will lose my OSPF config)

I need to send all traffic to a new interface as a DR test.  So basically want to prefer this new Vlan Interface to existing OSPF routes.

Thanks

 

3 REPLIES 3
larrymac
Frequent Advisor

Re: Static Route Preferred over OSPF learned route

If I just manaully add in static routes for the networks will this preference override the OSPF learned route?

Example: (IP changed) 

OSPF learned route:

192.168.1.0/24  O_ASE  150  18  192.168.10.6

Static Route:

192.168.1.0/24  STATIC    60  0  192.168.20.6

This could take some time as there is quite a lot of networks.  So is there another way of accomplishing this?

 

16again
Respected Contributor

Re: Static Route Preferred over OSPF learned route

couple of rules (ordered)
-longest matching route wins:  so 192.168.0.0.24 beats 192.168.0.0/16 beats 0.0.0.0
-For equal routes, administrative distance  (AD here called preference) is tie-breaker.  Lower is better.  Normally, type of route sets AD.
-If preference is also equal, cost is last tie breaker. 

So you can duplicate all routes already present for static routes, and make sure new routes all have lower preference

larrymac
Frequent Advisor

Re: Static Route Preferred over OSPF learned route

That's what I'll have to do so. Pity there wasn't a way of temp clearing the routing table and adding in a default route for all traffic.....
Thanks for the reply