modifying route metric with ospf

Discussion in 'Cisco' started by phil41, Sep 28, 2005.

  1. phil41

    phil41 Guest


    I need to modify the metric of network routes announced by a ospf
    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 area 0
    network area 0
    network area 0

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

    Thanks for your help
    phil41, Sep 28, 2005
    1. Advertisements

  2. phil41

    Doan Guest

    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, Sep 28, 2005
    1. Advertisements

  3. phil41

    cisco Guest

    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
    cisco, Sep 29, 2005
  4. phil41

    phil41 Guest

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

    phil41, Sep 29, 2005
  5. phil41

    phil41 Guest

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

    phil41, Sep 29, 2005
  6. phil41

    cisco Guest


    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
    cisco, Sep 29, 2005
  7. phil41

    Merv Guest

    The short answer is no.

    What is the routing problem that you are trying to solve ???
    Merv, Sep 29, 2005
  8. phil41

    phil41 Guest

    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
    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-2 and CE1-CE2 are in the same ospf area.
    myrouter1 and 2 are in HSRP and have the same networks and route

    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.
    phil41, Sep 30, 2005
  9. phil41

    Doan Guest

    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, Sep 30, 2005
  10. phil41

    Merv Guest

    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.
    Merv, Sep 30, 2005
  11. phil41

    phil41 Guest

    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

    phil41, Oct 3, 2005
  12. phil41

    Thomas Sulkiewicz

    Feb 23, 2010
    Likes Received:
    Sydney, Australia
    another way that might work could be to change the ethernet interface from ospf broadcast to point-to-multipoint, then assign each neighboring router a cost with the neighbor command.

    router ospf 10
    network area 0
    network area 0
    neighbor cost 20
    neighbor cost 30

    this way you can assign a weight to each hop, but you will need to assign a cost to every neighboring router, by default the router with the lowest cost will be the next hop for all of your routes.
    Thomas Sulkiewicz, Feb 23, 2010
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.