Skip navigation
Cisco Learning Home > Certifications > Routing & Switching (CCNP) > Discussions

_Communities

This Question is Answered
2268 Views 12 Replies Latest reply: Jul 17, 2011 12:46 PM by Brian RSS

Currently Being Moderated

OSPF vs EIGRP

Jul 17, 2011 8:45 AM

Subramaniya Karthic 184 posts since
Aug 3, 2010

I have a doubt in OSPF vs EIGRP's behavior

 

In OSPF, a router learns a route through 3 neighbors. However when I try to put a distribute list to block the route through the best route neighbor, I dont see the second best route getting into routing Table.

 

However in EIGRP if I learn a route through 3 neighbors and if I add a distribute list in for 1 neighbor, the best route still gets installed with the second neighbor kickin in.

 


Please confirm if this is the right behavior

  • Brian 2,971 posts since
    Aug 17, 2009
    Currently Being Moderated
    1. Jul 17, 2011 9:30 AM (in response to Subramaniya Karthic)
    Re: OSPF vs EIGRP

    This would depend on the topology and the costs/metrics learned.  If you learned a route through three other routers each with equal costs via OSPF, then yes the second and third routes will be in the routing table.  If this costs were different then the second route would not appear until the link for the first were actually down.

     

    Do you have a network topology and the configuration of the routers?

     

    Brian

  • Paul Stewart  -  CCIE Security, CCSI 6,952 posts since
    Jul 18, 2008
    Currently Being Moderated
    3. Jul 17, 2011 10:24 AM (in response to Subramaniya Karthic)
    Re: OSPF vs EIGRP

    OSPF could not filter those routes between routers.  OSPF could only filter that route on the originating router.  Rememer, the other routers all have the entire OSPF database. 

  • Brian 2,971 posts since
    Aug 17, 2009
    Currently Being Moderated
    4. Jul 17, 2011 10:31 AM (in response to Subramaniya Karthic)
    Re: OSPF vs EIGRP

    Yes, what route are you trying to filter and on which router are you trying to filter it from?

     

    Then on the router in which you wish to filter the route, please do a "sh ip ospf database" and highlight the route you wish to filter.

     

    I have a little diagram (shown below) I did in GNS3 and configured using EIGRP and OSPF.  I filter the 192.168.100.0/24 route coming from R3.  It worked just fine.

     

    Screenshot-ospf.png

     

    Here is the configuration on R1.  I filtered the 192.168.100.0/24 route received from R3.

     

    router ospf 1

    router-id 1.1.1.1

    log-adjacency-changes

    network 172.16.2.0 0.0.0.255 area 0

    network 172.16.3.0 0.0.0.255 area 0

    network 172.16.4.0 0.0.0.255 area 0

    distribute-list route-map FILTER-R3 in

    !

    access-list 1 permit 3.3.3.3     <--- this is R3's RID

    access-list 2 permit 192.168.100.0 0.0.0.255  <--- the route to be filtered

    !

    route-map FILTER-R3 deny 10

    match ip route-source 1

    match ip address 2

    !

    route-map FILTER-R3 permit 20

    !

     

     

    RT1#sh ip rou 192.168.100.0

    Routing entry for 192.168.100.0/24

      Known via "ospf 1", distance 110, metric 65, type inter area

      Last update from 172.16.4.4 on Serial1/2, 00:00:44 ago

      Routing Descriptor Blocks:

        172.16.4.4, from 4.4.4.4, 00:00:44 ago, via Serial1/2

          Route metric is 65, traffic share count is 1

      * 172.16.2.2, from 2.2.2.2, 00:00:44 ago, via Serial1/0

          Route metric is 65, traffic share count is 1

     

    RT1#

    RT1#sh ip rou

    Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

           D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

           N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

           E1 - OSPF external type 1, E2 - OSPF external type 2

           i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

           ia - IS-IS inter area, * - candidate default, U - per-user static route

           o - ODR, P - periodic downloaded static route

     

    Gateway of last resort is not set

     

         192.168.30.0/32 is subnetted, 1 subnets

    O IA    192.168.30.100 [110/65] via 172.16.3.3, 00:04:04, Serial1/1

         192.168.40.0/32 is subnetted, 1 subnets

    O IA    192.168.40.100 [110/65] via 172.16.4.4, 00:04:04, Serial1/2

         172.16.0.0/24 is subnetted, 5 subnets

    C       172.16.4.0 is directly connected, Serial1/2

    C       172.16.0.0 is directly connected, Loopback0

    C       172.16.1.0 is directly connected, Loopback1

    C       172.16.2.0 is directly connected, Serial1/0

    C       172.16.3.0 is directly connected, Serial1/1

         192.168.20.0/32 is subnetted, 1 subnets

    O IA    192.168.20.100 [110/65] via 172.16.2.2, 00:04:04, Serial1/0

    O IA 192.168.100.0/24 [110/65] via 172.16.4.4, 00:04:04, Serial1/2

                          [110/65] via 172.16.2.2, 00:04:04, Serial1/0

    RT1#

     

     

    Let me know if you have any questions.

     

    Brian

  • Brian 2,971 posts since
    Aug 17, 2009
    Currently Being Moderated
    5. Jul 17, 2011 10:40 AM (in response to Subramaniya Karthic)
    Re: OSPF vs EIGRP

    What is the route you are trying to filter?  OSPF can filter routes just fine (see my example.)  Keep in mind, OSPF will not filter the actual advertisement (LSA) but what is installed in the local routing table.

     

    So if you look at my example above R2, R3 and R4 all advertised the 192.168.100.0/24 network to R1.  verified by the OSPF database.

     

    RT1#sh ip ospf database

     

                OSPF Router with ID (1.1.1.1) (Process ID 1)

     

                    Router Link States (Area 0)

     

    Link ID         ADV Router      Age         Seq#       Checksum Link count

    1.1.1.1         1.1.1.1         752         0x80000001 0x004277 6

    2.2.2.2         2.2.2.2         753         0x80000001 0x00719E 2

    3.3.3.3         3.3.3.3         753         0x80000001 0x0055AF 2

    4.4.4.4         4.4.4.4         748         0x80000002 0x0037C1 2

     

                    Summary Net Link States (Area 0)

     

    Link ID         ADV Router      Age         Seq#       Checksum

    192.168.20.100  2.2.2.2         749         0x80000001 0x00DC75

    192.168.30.100  3.3.3.3         748         0x80000001 0x0050F3

    192.168.40.100  4.4.4.4         749         0x80000001 0x00C372

    192.168.100.0   2.2.2.2         749         0x80000001 0x005511

    192.168.100.0   3.3.3.3         748         0x80000001 0x00372B

    192.168.100.0   4.4.4.4         749         0x80000001 0x001945

    RT1#

     

    But I filtered the route from R3 from being installed in R1's routing table.

     

    RT1#sh ip rou

    Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

           D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

           N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

           E1 - OSPF external type 1, E2 - OSPF external type 2

           i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

           ia - IS-IS inter area, * - candidate default, U - per-user static route

           o - ODR, P - periodic downloaded static route

     

    Gateway of last resort is not set

     

         192.168.30.0/32 is subnetted, 1 subnets                                                             

    O IA    192.168.30.100 [110/65] via 172.16.3.3, 00:13:27, Serial1/1                                      

         192.168.40.0/32 is subnetted, 1 subnets                                                             

    O IA    192.168.40.100 [110/65] via 172.16.4.4, 00:13:27, Serial1/2                                      

         172.16.0.0/24 is subnetted, 5 subnets                                                               

    C       172.16.4.0 is directly connected, Serial1/2                                                      

    C       172.16.0.0 is directly connected, Loopback0                                                      

    C       172.16.1.0 is directly connected, Loopback1                                                      

    C       172.16.2.0 is directly connected, Serial1/0                                                      

    C       172.16.3.0 is directly connected, Serial1/1

         192.168.20.0/32 is subnetted, 1 subnets

    O IA    192.168.20.100 [110/65] via 172.16.2.2, 00:13:27, Serial1/0

    O IA 192.168.100.0/24 [110/65] via 172.16.4.4, 00:13:27, Serial1/2 

                                      [110/65] via 172.16.2.2, 00:13:27, Serial1/0

    RT1#

     

    HTH

  • Paul Stewart  -  CCIE Security, CCSI 6,952 posts since
    Jul 18, 2008
    Currently Being Moderated
    6. Jul 17, 2011 10:45 AM (in response to Brian)
    Re: OSPF vs EIGRP

    Very good example and explanation. Thanks.

  • Paul Stewart  -  CCIE Security, CCSI 6,952 posts since
    Jul 18, 2008
    Currently Being Moderated
    9. Jul 17, 2011 10:55 AM (in response to Subramaniya Karthic)
    Re: OSPF vs EIGRP

    Okay, my statement was a bit incorrect. The distribute list is applicable in ospf but is more centric to the rib.

  • Brian 2,971 posts since
    Aug 17, 2009
    Currently Being Moderated
    12. Jul 17, 2011 12:46 PM (in response to Subramaniya Karthic)
    Re: OSPF vs EIGRP

    I think you have a misconfiguration.

     

    Here is an example using you topology.  R1 has network 10.0.0.0/24 on its loopback interface and I am going to filter this route coming from R3 from R6 routing table.

     

    Screenshot-ospf-1.png

     

    R6#sh ip rou

    Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

           D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

           N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

           E1 - OSPF external type 1, E2 - OSPF external type 2

           i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

           ia - IS-IS inter area, * - candidate default, U - per-user static route

           o - ODR, P - periodic downloaded static route

     

    Gateway of last resort is not set

     

         36.0.0.0/24 is subnetted, 1 subnets

    C       36.0.0.0 is directly connected, FastEthernet0/1

         23.0.0.0/24 is subnetted, 1 subnets

    O       23.0.0.0 [110/20] via 36.0.0.3, 00:00:07, FastEthernet0/1

         25.0.0.0/24 is subnetted, 1 subnets

    O       25.0.0.0 [110/20] via 56.0.0.5, 00:00:07, FastEthernet0/0

         10.0.0.0/24 is subnetted, 1 subnets

    O IA    10.0.0.0 [110/31] via 56.0.0.5, 00:00:07, FastEthernet0/0

                     [110/31] via 36.0.0.3, 00:00:07, FastEthernet0/1  <--- I will filter this route

         56.0.0.0/24 is subnetted, 1 subnets

    C       56.0.0.0 is directly connected, FastEthernet0/0

         12.0.0.0/24 is subnetted, 1 subnets

    O       12.0.0.0 [110/30] via 56.0.0.5, 00:00:07, FastEthernet0/0

                     [110/30] via 36.0.0.3, 00:00:07, FastEthernet0/1

         14.0.0.0/24 is subnetted, 1 subnets

    O       14.0.0.0 [110/30] via 56.0.0.5, 00:00:07, FastEthernet0/0

         45.0.0.0/24 is subnetted, 1 subnets

    O       45.0.0.0 [110/20] via 56.0.0.5, 00:00:07, FastEthernet0/0

    R6#

     

    =======================

    access-list 1 permit 36.0.0.3

    access-list 2 permit 10.0.0.0 0.0.0.255

    !

    route-map FILTER-R3 deny 10

    match ip address 2

    match ip next-hop 1

    !

    route-map FILTER-R3 permit 20

    !

    =======================

     

     

    R6(config)#router ospf 1

    R6(config-router)#distribute-list route-map FILTER-R3 in

    R6(config-router)#end

    R6#sh

    *Mar  1 01:10:20.071: %SYS-5-CONFIG_I: Configured from console by console

    R6#sh ip rou

    Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

           D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

           N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

           E1 - OSPF external type 1, E2 - OSPF external type 2

           i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

           ia - IS-IS inter area, * - candidate default, U - per-user static route

           o - ODR, P - periodic downloaded static route

     

    Gateway of last resort is not set

     

         36.0.0.0/24 is subnetted, 1 subnets

    C       36.0.0.0 is directly connected, FastEthernet0/1

         23.0.0.0/24 is subnetted, 1 subnets

    O       23.0.0.0 [110/20] via 36.0.0.3, 00:00:06, FastEthernet0/1

         25.0.0.0/24 is subnetted, 1 subnets

    O       25.0.0.0 [110/20] via 56.0.0.5, 00:00:06, FastEthernet0/0

         10.0.0.0/24 is subnetted, 1 subnets

    O IA    10.0.0.0 [110/31] via 56.0.0.5, 00:00:06, FastEthernet0/0

         56.0.0.0/24 is subnetted, 1 subnets

    C       56.0.0.0 is directly connected, FastEthernet0/0

         12.0.0.0/24 is subnetted, 1 subnets

    O       12.0.0.0 [110/30] via 56.0.0.5, 00:00:06, FastEthernet0/0

                     [110/30] via 36.0.0.3, 00:00:06, FastEthernet0/1

         14.0.0.0/24 is subnetted, 1 subnets

    O       14.0.0.0 [110/30] via 56.0.0.5, 00:00:07, FastEthernet0/0

         45.0.0.0/24 is subnetted, 1 subnets

    O       45.0.0.0 [110/20] via 56.0.0.5, 00:00:07, FastEthernet0/0

    R6#

     

    So, not sure how you are configuring your ACL and route-map for use with the distribut-list, but if you "match" the "route-source" in the route-map it will filter the route from all neighbors because R1 is the advertising router.  This is why I "match" using the next-hop ip address (R3 in my example) and I was able to filter the route through R3 from R6 routing table.  Keep in mind, this does not filter the route from being learned through the LSAs.

     

    R6#sh ip ospf database

     

                OSPF Router with ID (6.6.6.6) (Process ID 1)

     

                    Router Link States (Area 0)

     

    Link ID         ADV Router      Age         Seq#       Checksum Link count

    1.1.1.1         1.1.1.1         1383        0x80000005 0x00FDCD 2

    2.2.2.2         2.2.2.2         948         0x80000007 0x002539 3

    3.3.3.3         3.3.3.3         1376        0x80000005 0x003A39 2

    4.4.4.4         4.4.4.4         1382        0x80000006 0x003E2A 2

    5.5.5.5         5.5.5.5         1000        0x80000007 0x00C4ED 3

    6.6.6.6         6.6.6.6         1381        0x80000005 0x00858A 2

     

                    Net Link States (Area 0)

     

    Link ID         ADV Router      Age         Seq#       Checksum

    12.0.0.1        1.1.1.1         1814        0x80000002 0x005FBC

    14.0.0.1        1.1.1.1         1383        0x80000001 0x00AB67

    23.0.0.2        2.2.2.2         1712        0x80000002 0x00FB08

    25.0.0.2        2.2.2.2         1456        0x80000002 0x0046B3

    36.0.0.3        3.3.3.3         1376        0x80000002 0x00E2FE

    45.0.0.4        4.4.4.4         1601        0x80000002 0x00359E

    56.0.0.5        5.5.5.5         1486        0x80000002 0x00D1E9

     

                    Summary Net Link States (Area 0)

     

    Link ID         ADV Router      Age         Seq#       Checksum

    10.0.0.0        1.1.1.1         1814        0x80000002 0x00F03C

    R6#

     

    This is because in OSPF all routers in the same area must have the same LSDB.  The "distribute-list" command works differently in OSPF than it does with distance-vector routing protocols such as Routing Information Protocol (RIP) and Enhanced Interior Gateway Routing Protocol (EIGRP).  You cannot filter OSPF routes from entering the OSPF database, you can only filter routes from entering the local routing table.

     

    HTH

Actions

More Like This

  • Retrieving data ...

Bookmarked By (1)