modifying route metric with ospf

Hello,

I need to modify the metric of network routes announced by a ospf router. For exemple, half of the announced routes with metric 10 and the other half with metric 20. For that, I'm using route-map and it's ok for all network matching rules except those defined in the router ospf instruction:

router ospf 1 redistribute connected subnets route-map routes_cnx redistribute static subnets route-map routes_stats network 172.0.0.0 0.0.0.255 area 0 network 172.1.0.0 0.0.0.255 area 0 network 192.168.254.1 0.0.0.0 area 0

Is there a way to put a different metric to each network defined in router ospf 1 ?

Thanks for your help

Reply to
phil41
Loading thread data ...

In OSPF, the metric is based on the bandwidth of the interfaces. The default is 10*8/BW. You can change this with "ip ospf cost" under the interface configuration.

Doan

Reply to
Doan

i could be wrong but you should be trying to modify the metric on the receing router . route map is the correct way to do it . e

Reply to
cisco

Yes but metric will be the same for the 3 networks and I need to put distinct metrics for them.

Phil

Reply to
phil41

I can't, the receiver is my provider router.

Phil

Reply to
phil41

ok

why not just use the keyword "metric"

let say for example you want your static to be redistributed with a metric of 10

router ospf 1 redistribute static metric 10 subnets

Reply to
cisco

The short answer is no.

What is the routing problem that you are trying to solve ???

Reply to
Merv

I'm migrating my company sites internework from Frame Relay to an operator MPLS network. For each location, I have several internal networks and custumer access points. Actually, each network is static routed by the operator through the MPLS backbone. The objective is to expend my ospf routing over the mpls.

For each location I have the following myrouter1-CE1-PE1 myrouter2-CE2-PE2

myrouter1-2 and CE1-CE2 are in the same ospf area. myrouter1 and 2 are in HSRP and have the same networks and route declared.

For load sharing and backup purpose, my operator ask me to modify the metric for half of the routes announced by myrouter1 and myrouter2: myrouter1 routelist1 metric 10 myrouter1 routelist2 metric 20 myrouter2 routelist1 metric 20 myrouter2 routelist2 metric 10

I can do that for static and connected subnet with route-map but not for networks declared in the router ospf command.

Reply to
phil41

I don't think you can do that within ospf. Since both routers are in the same area, they share the same database. One solution might be to run another routing protocol for those networks and then redistribute them into ospf using route-maps just as you did with the static and conntected subnets.

Doan

Reply to
Doan

You perhaps need to have further discussion with your MPLS provider about the pros and cons of the variosu MPLS CE-PE routing protocols.

For example, what the provider is asking you to do would be trivial if BGP were the MPLS CE-PE routing protocol. However that may mean redistributing your OSPF routes into BGP.

Reply to
Merv

A got a solution with Cisco: running a second OSPF process on my routers with same networks area, redistribute each process in the other and apply route-map on the second process. I have lab tested this solution, and it's ok.

Thanks all for your help

Philippe

Reply to
phil41

Cabling-Design.com Forums website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.