modifying route metric with ospf

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

  1. phil41

    phil41 Guest

    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
     
    phil41, Sep 28, 2005
    #1
    1. Advertising

  2. phil41

    Doan Guest

    On 28 Sep 2005, phil41 wrote:

    > 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
    >

    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
     
    Doan, Sep 28, 2005
    #2
    1. Advertising

  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
    #3
  4. phil41

    phil41 Guest

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

    Phil
     
    phil41, Sep 29, 2005
    #4
  5. phil41

    phil41 Guest

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

    Phil
     
    phil41, Sep 29, 2005
    #5
  6. phil41

    cisco Guest

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

    Merv Guest

    The short answer is no.

    What is the routing problem that you are trying to solve ???
     
    Merv, Sep 29, 2005
    #7
  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
    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.
     
    phil41, Sep 30, 2005
    #8
  9. phil41

    Doan Guest

    On 30 Sep 2005, phil41 wrote:

    > 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.
    >

    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
     
    Doan, Sep 30, 2005
    #9
  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
    #10
  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

    Philippe
     
    phil41, Oct 3, 2005
    #11
  12. phil41

    Thomas Sulkiewicz

    Joined:
    Feb 23, 2010
    Messages:
    1
    Location:
    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.

    eg:
    router ospf 10
    network 10.0.0.0 0.0.255.255 area 0
    network 172.16.0.0 0.0.0.255 area 0
    neighbor 172.16.0.2 cost 20
    neighbor 172.16.0.3 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
    #12
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. E.Finlayson
    Replies:
    0
    Views:
    1,688
    E.Finlayson
    Sep 10, 2004
  2. BB

    How OSPF metric?

    BB, Jan 5, 2005, in forum: Cisco
    Replies:
    3
    Views:
    34,690
    peart
    Jun 18, 2008
  3. response3
    Replies:
    0
    Views:
    654
    response3
    Apr 23, 2007
  4. Replies:
    9
    Views:
    5,309
    Scott Perry
    Aug 7, 2008
  5. pvarulkumar
    Replies:
    0
    Views:
    1,093
    pvarulkumar
    Oct 14, 2008
Loading...

Share This Page