12 Replies Latest reply: Jul 17, 2011 12:46 PM by Brian RSS

    OSPF vs EIGRP

    Subramaniya Karthic

      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

        • 1. Re: OSPF vs EIGRP
          Brian

          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

           

          • 2. Re: OSPF vs EIGRP
            Subramaniya Karthic

            untitled.bmp

             

            There is my topology.THe only link that is in a different are other than 0 is R1-R4 in area 4 ...The ip addressing scheming is pretty straightforward R1 and R2 is connected by 12.1.1.0/24 and so on..

             

            R1 has the loopback and is learnt through all three neighbors by R5.

             

            R5's routing Table

             

                 1.0.0.0/32 is subnetted, 1 subnets

            O       1.1.1.1 [110/12] via 25.1.1.2, 00:02:04, FastEthernet1/0

                 5.0.0.0/32 is subnetted, 1 subnets

            C       5.5.5.5 is directly connected, Loopback1

                 36.0.0.0/24 is subnetted, 1 subnets

            O       36.1.1.0 [110/20] via 56.1.1.6, 00:02:04, FastEthernet0/1

                 23.0.0.0/24 is subnetted, 1 subnets

            O       23.1.1.0 [110/11] via 25.1.1.2, 00:02:04, FastEthernet1/0

                 25.0.0.0/24 is subnetted, 1 subnets

            C       25.1.1.0 is directly connected, FastEthernet1/0

                 56.0.0.0/24 is subnetted, 1 subnets

            C       56.1.1.0 is directly connected, FastEthernet0/1

                 12.0.0.0/24 is subnetted, 1 subnets

            O       12.1.1.0 [110/11] via 25.1.1.2, 00:02:06, FastEthernet1/0

                 14.0.0.0/24 is subnetted, 1 subnets

            O IA    14.1.1.0 [110/20] via 45.1.1.4, 00:02:06, FastEthernet0/0

                 45.0.0.0/24 is subnetted, 1 subnets

            C       45.1.1.0 is directly connected, FastEthernet0/0

             

            router ospf 1

            log-adjacency-changes

            passive-interface Loopback1

            network 5.5.5.5 0.0.0.0 area 0

            network 25.1.1.0 0.0.0.255 area 0

            network 45.1.1.0 0.0.0.255 area 0

            network 56.1.1.0 0.0.0.255 area 0

             

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

             

            After adding

            distribute-list 1 in FastEthernet0/0 in router ospf 1, I lose the route from RT.

             

            OMG!!!!!!

             

            A new improvement !! Looks like OSPF did not consider the fact I asked OSPF to filter only the route through fa0/0

             

            My best route here is  via fa1/0...

             

            Any comments/

            • 3. Re: OSPF vs EIGRP
              Paul Stewart  -  CCIE Security

              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. 

              • 4. Re: OSPF vs EIGRP
                Brian

                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

                 

                • 5. Re: OSPF vs EIGRP
                  Brian

                  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

                   

                  • 6. Re: OSPF vs EIGRP
                    Paul Stewart  -  CCIE Security

                    Very good example and explanation. Thanks.

                    • 7. Re: OSPF vs EIGRP
                      Subramaniya Karthic

                      I m filtering the R1's loopback on the R5 router.

                       

                      distribute-list 1 in FastEthernet0/0

                      • 8. Re: OSPF vs EIGRP
                        Subramaniya Karthic

                        My concern is that  R5 is learning the 1.1.1.1 IP through all three neighbors. I m using the distribute list only to filter the 1.1.1.1 network learnt via fa1/0.. However it seems that it is filtering the routes via all interfaces

                        • 9. Re: OSPF vs EIGRP
                          Paul Stewart  -  CCIE Security

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

                          • 10. Re: OSPF vs EIGRP
                            Subramaniya Karthic

                            R5#sh ip ospf database router 12.1.1.1

                             

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

                             

                                            Router Link States (Area 0)

                             

                              Routing Bit Set on this LSA

                              LS age: 1867

                              Options: (No TOS-capability, DC)

                              LS Type: Router Links

                              Link State ID: 12.1.1.1

                              Advertising Router: 12.1.1.1

                              LS Seq Number: 80000004

                              Checksum: 0xF6DC

                              Length: 48

                              Area Border Router

                              Number of Links: 2

                             

                                Link connected to: a Stub Network

                                 (Link ID) Network/subnet number: 1.1.1.1

                                 (Link Data) Network Mask: 255.255.255.255

                                  Number of TOS metrics: 0

                                   TOS 0 Metrics: 1

                             

                                Link connected to: a Transit Network

                                 (Link ID) Designated Router address: 12.1.1.2

                                 (Link Data) Router Interface address: 12.1.1.1

                                  Number of TOS metrics: 0

                                   TOS 0 Metrics: 10

                             

                            This is the LSA..

                            • 11. Re: OSPF vs EIGRP
                              Subramaniya Karthic

                              I guess things are working as expected.. Thank you for the help

                              • 12. Re: OSPF vs EIGRP
                                Brian

                                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