OSPF Path selection

Greeting all [:)]


This evening i got stuck with pth selection in ospf however i did it using different way but i really want to know what`s wrong with my configuration 

R1 -------- R3------------R4
|
|
R2---------------------R4


In R4 i have a loopback address 4.4.4.0/24 So in R1 i got two entries in my routing table for the the network 4.4.4.0/24 via R3 and R2

What i wanna do is to increase the metric of the route receivbed from  R3 so that the path through 4.4.4.0/24 will be via R2

In R1 i have done this configuration but it`s not working even my route-map is not matching any pakcet :S

!
access-list 3 permit 131.1.13.3  (IP add of the serial link in R3)
access-list 4 permit 4.4.4.0 0.0.0.255
!
!
!
route-map METRIC permit 10
 match ip address 4
 match ip route-source 3
 set metric 1000
!        
route-map METRIC permit 40
!                           


Router ospf 1
distibution-list route-map METRIC in

To answer the question i just tried something else which consits in : R3 have to advertise the max metric

router ospf 1
max-metric router-las

Can anyone correct me with the route-map plz


thanks

Comments

  • Hey Dude,

    Did you change the loopback address to "ip ospf network point-to-point"? If not, ospf will see it as a /32 and it wont match the ACL!

    Give that a try and see if it fixes the issue!

    -Adrian


    On Sep 29, 2009, at 6:56 PM, Seifeddine wrote:

    Greeting all Smile


    This evening i got stuck with pth selection in ospf however i did it using different way but i really want to know what`s wrong with my configuration  

    R1 -------- R3------------R4
    |
    |
    R2---------------------R4


    In R4 i have a loopback address 4.4.4.0/24 So in R1 i got two entries in my routing table for the the network 4.4.4.0/24 via R3 and R2

    What i wanna do is to increase the metric of the route receivbed from  R3 so that the path through 4.4.4.0/24 will be via R2

    In R1 i have done this configuration but it`s not working even my route-map is not matching any pakcet :S

    !
    access-list 3 permit 131.1.13.3  (IP add of the serial link in R3)
    access-list 4 permit 4.4.4.0 0.0.0.255
    !
    !
    !
    route-map METRIC permit 10
     match ip address 4
     match ip route-source 3
     set metric 1000
    !         
    route-map METRIC permit 40
    !                            


    Router ospf 1
    distibution-list route-map METRIC in

    To answer the question i just tried something else which consits in : R3 have to advertise the max metric

    router ospf 1
    max-metric router-las

    Can anyone correct me with the route-map plz


    thanks




    Internetwork Expert - The Industry Leader in CCIE Preparation
    http://www.internetworkexpert.com

    Subscription information may be found at:
    http://www.ieoc.com/forums/ForumSubscriptions.aspx

  • thanks for your reply Adrian, yep i`m using point-to-point type and i`ve added the log at then of the ACL and i can even receive a log message that the ACL is matching packet but the route-map isn`t matching anything.

     

    Thanks

  • You could try this... 

    r1(config-router)#neighbor 131.1.13.3 cost ?
      <1-65535>  metric







    On Sep 29, 2009, at 7:33 PM, Seifeddine wrote:

    thanks for your reply Adrian, yep i`m using point-to-point type and i`ve added the log at then of the ACL and i can even receive a log message that the ACL is matching packet but the route-map isn`t matching anything.

     

    Thanks




    Internetwork Expert - The Industry Leader in CCIE Preparation
    http://www.internetworkexpert.com

    Subscription information may be found at:
    http://www.ieoc.com/forums/ForumSubscriptions.aspx

  • Thanks Adrian for your help , appreciate it :) i`ve actually found a command replacememnt but my point is to try to see what are my mistakes :)

  • I don't think you can use neighbor cost command on point-to-point interfaces only p2m and nbma.

    Also you route map is wrong, it should be

    match ip add

    match ip next-hop  (rather then  source).

    But the problem is not in route map either, its that you can't manipulate intra area metric like that,

    the way ospf calculates metric is it adds cost of all interfaces up to the link thats advertised in router lsa1.

    Filtering route would have same effect as adding metric (if you could). But filter methods, such as using administrative distance, or route map like the one you made would only filter route if it were to enter routing table anyway. Given your topology, the only route to 4.4.4.4 is over R3, if you filter that out, R1 is not going to install route from R2. If you had two equal cost paths in your routing table for 4.4.4.0, in other words two descriptor blocks one with next hop to R2 and one with next hop to R3 then using the methods i described you could filter one of the descriptor blocks.

    So the only way to route over R2 is to change cost of your link to R3, or R3's to R4.

     

    Just a small edit here:

    for some reason i assumed that shortest path to R4 is via R3 ONLY (your drawing screwed me up). In case you got equal cost paths you can filter out one.

     

    HTH


  • "r9(config-if)#ip ospf cost 100" 

    This will give that network a higher cost and the router will chose the other path. 

         1.0.0.0/32 is subnetted, 1 subnets
    O       1.1.1.1 [110/101] via 10.1.1.1, 00:00:02, FastEthernet0/0
         2.0.0.0/24 is subnetted, 1 subnets
    C       2.2.2.0 is directly connected, Loopback0
         10.0.0.0/24 is subnetted, 1 subnets
    C       10.1.1.0 is directly connected, FastEthernet0/0
    R8(config-router)#

    Why would you think you couldn't modify intra-area metrics?






    On Sep 29, 2009, at 8:15 PM, jkdrouter wrote:

    I don't think you can use neighbor cost command on point-to-point interfaces only p2m and nbma.

    Also you route map is wrong, it should be

    match ip add

    match ip next-hop  (rather then  source).

    But the problem is not in route map either, its that you can't manipulate intra area metric like that,

    the way ospf calculates metric is it adds cost of all interfaces up to the link thats advertised in router lsa1.

    Filtering route would have same effect as adding metric (if you could). But filter methods, such as using administrative distance, or route map like the one you made would only filter route if it were to enter routing table anyway. Given your topology, the only route to 4.4.4.4 is over R3, if you filter that out, R1 is not going to install route from R2.

    So the only way to route over R2 is to change cost of your link to R3, or R3's to R4.




    Internetwork Expert - The Industry Leader in CCIE Preparation
    http://www.internetworkexpert.com

    Subscription information may be found at:
    http://www.ieoc.com/forums/ForumSubscriptions.aspx

  •  




    "r9(config-if)#ip ospf cost 100" 



    This will give that network a higher cost and the router will chose the other path. 





         1.0.0.0/32 is subnetted, 1 subnets

    O       1.1.1.1 [110/101] via 10.1.1.1, 00:00:02, FastEthernet0/0

         2.0.0.0/24 is subnetted, 1 subnets

    C       2.2.2.0 is directly connected, Loopback0

         10.0.0.0/24 is subnetted, 1 subnets

    C       10.1.1.0 is directly connected, FastEthernet0/0

    R8(config-router)#



    Why would you think you couldn't modify intra-area metrics?



    Because you can't.

    I said you can't modify intra area metric like you can in distance vector protocols by directly adding metric.



    You can directly change cost of your interface, but that affects all your routes. 



     

     

  • So if you cant modify intra-area route's metrics what is the option below then?

    Router(config-router)#distance ospf ?
      external    External type 5 and type 7 routes
      inter-area  Inter-area routes
      intra-area  Intra-area routes

    Router(config-router)#distance ospf

    router ospf 1
     log-adjacency-changes
     network 1.1.1.0 0.0.0.255 area 0
     network 10.1.1.0 0.0.0.255 area 0
     distance ospf intra-area 137

     

    O       2.2.2.2 [137/2] via 10.1.1.2, 00:00:40, FastEthernet0/1
         10.0.0.0/24 is subnetted, 1 subnets
    C       10.1.1.0 is directly connected, FastEthernet0/1
    Router(config-router)#

     

    OR... OR...

     

    Router(config-router)#distance ?              
      <1-255>  Administrative distance
      ospf     OSPF distance

    Router(config-router)#distance 137 ?
      A.B.C.D  IP Source address
      <cr>
    router ospf 1
     log-adjacency-changes
     network 1.1.1.0 0.0.0.255 area 0
     network 10.1.1.0 0.0.0.255 area 0
     distance 137 2.2.2.2 0.0.0.0 50

    access-list 50 permit 3.3.3.0 0.0.0.255 log

     

    O       2.2.2.2 [110/2] via 10.1.1.2, 00:01:23, FastEthernet0/1
         3.0.0.0/24 is subnetted, 1 subnets
    O       3.3.3.0 [137/2] via 10.1.1.2, 00:01:23, FastEthernet0/1

     

    So with the 2 above options you can modify "INTRA-AREA" route's from a neighbor or a sigle route from a neighbor.

     

    HTHs

     

     

  • So if you cant modify intra-area route's metrics what is the option below then?

     

    It is the option of changing AD of routes, not metric.

    Reread my 1st post in this topic,

    You cannot add metric like you can do with distance vector protocols, which is what original poster intended to do with his route map.

     

     

  • do u want advanced way

    try his

    access-list 3 permit (R3)

    access-list 10 permit (R4 IP)

    route-map map1 dny 10

    match ip add 10

    match ip next-hop 3

    route-map map1 permit 30

     

    router ospf 1

    ditribute-list route-map map1 in

    ip sla 1

    icmp-echo (R2 IP address)

    track 1 rtr 1 reachability

    even manager applet IGP

    event track 10 state down

    action 1.1 cli command "enable"

    action 1.2 cli command "config t"

    action 1.3 cli command "router ospf 1"

    action 1.4 cli command " no ditribute-list route-map map1 in "

    this will use R2 to reach R4 IP if R2 down R3 will be used

    i thnk this good example of how to use EEM as well as it is part of CCIEv4

    hope this helps

  • Hi Jkdrouter,

    You are defenetly right and it`s my misunderstanding :) the best way for this is to use either neighbor cost or under the interface with ip ospf cost ... also the Max-metric router-lsa :)

     

    Thanks again

Sign In or Register to comment.