cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
445
Views
0
Helpful
0
Comments
Meddane
VIP
VIP

 Background:

In OSPF, there are many loop prevention mechanisms between ABR because the Vector Distance behavior OSPF in multi area design such as INTER-AREA LSA Type 3 loop prevention or P-Bit loop prevention.

Is there a loop prevention mechanism between ASBR?

Let's dive in

OSPF.PNG

 

Basic configuration of all routers:

 

R1:

interface FastEthernet0/0

 ip address 13.0.0.1 255.255.255.0

 ip ospf 1 area 0

 no shut

!

router ospf 1

 router-id 1.1.1.1

 default-information originate always

 

R2:

interface FastEthernet0/0

 ip address 23.0.0.2 255.255.255.0

 no shut

!

ip route 0.0.0.0 0.0.0.0 s0/0

!

router ospf 1

 router-id 2.2.2.2

!

router eigrp 1

 network 23.0.0.0

 redistribute static

 

R3:

interface FastEthernet0/1

 ip address 13.0.0.3 255.255.255.0

 ip ospf 1 area 0

 no shut

!

interface FastEthernet0/0

 ip address 23.0.0.3 255.255.255.0

 no shut

!

router ospf 1

 router-id 3.3.3.3

 

To allow R3 to access INTERNET, R1 injects a default route using default-information originate always command and R2 injects a default route using redistribute static command.

 

We can see below that R3 receives an LSA Type 5 default route from R1 with Routing bit set:

 

R3#show ip ospf database external

 

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

 

                Type-5 AS External Link States

 

  Routing Bit Set on this LSA in topology Base with MTID 0

  LS age: 1133

  Options: (No TOS-capability, DC, Upward)

  LS Type: AS External Link

  Link State ID: 0.0.0.0 (External Network Number )

  Advertising Router: 1.1.1.1

  LS Seq Number: 80000002

  Checksum: 0x1B92

  Length: 36

  Network Mask: /0

        Metric Type: 2 (Larger than any link state path)

        MTID: 0

        Metric: 1

        Forward Address: 0.0.0.0

        External Route Tag: 1

 

R3#

 

Now let's allow R1 to access the EIGRP domain by advertising a default route on R3 using the default-information originate always:

 

R3(config)#router osp 1

R3(config-router)#default-information originate always

 

We can see below that R3 is still receiving the LSA Type 5 from R1 but notice the missing of the routing bit in this LSA 5:

 

R3#show ip ospf database exter adv-router 1.1.1.1

 

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

 

                Type-5 AS External Link States

 

  LS age: 2008

  Options: (No TOS-capability, DC, Upward)

  LS Type: AS External Link

  Link State ID: 0.0.0.0 (External Network Number )

  Advertising Router: 1.1.1.1

  LS Seq Number: 80000002

  Checksum: 0x1B92

  Length: 36

  Network Mask: /0

        Metric Type: 2 (Larger than any link state path)

        MTID: 0

        Metric: 1

        Forward Address: 0.0.0.0

        External Route Tag: 1

 

R3#

 

To explain the missing of the routing bit field in the LSA Type 5's R1 , let's enable debugging:

 

R3#debug ip ospf spf external

OSPF SPF external debugging is on

R3#

 

From the debug output we can see that R3 don't install default routes from others since it is originating a default route with always keyword:

 

R3(config-router)#

*Nov 21 21:19:58.275: OSPF-1 SPF  : Schedule partial SPF type 5, LSID 0.0.0.0, adv_rtr 3.3.3.3 area dummy area

*Nov 21 21:19:58.283: OSPF-1 SPF  : Service partial SPF, spf instance 41, 0/1/0

*Nov 21 21:19:58.283: OSPF-1 INTER: Process partial summary spf queue

*Nov 21 21:19:58.283: OSPF-1 EXTER: Process partial external spf queue

*Nov 21 21:19:58.287: OSPF-1 EXTER: Process partial spfQ: type 5, LSID 0.0.0.0, mask 0.0.0.0, adv_rtr 3.3.3.3, age 0, seq 0x80000001, area dummy area

*Nov 21 21:19:58.287: OSPF-1 EXTER: Start partial processing Type 5 External LSA 0.0.0.0, mask 0.0.0.0

R3(config-router)#

*Nov 21 21:19:58.291: OSPF-1 EXTER:  adv_rtr 1.1.1.1, age 1282, seq 0x80000002, metric 1, metric-type 2, fw-addr 0.0.0.0

*Nov 21 21:19:58.291: OSPF-1 EXTER:    We originate default always. Don't install default from others

*Nov 21 21:19:58.295: OSPF-1 EXTER: Start partial processing Type 5 External LSA 0.0.0.0, mask 0.0.0.0

*Nov 21 21:19:58.295: OSPF-1 EXTER:  adv_rtr 3.3.3.3, age 0, seq 0x80000001, metric 1, metric-type 2, fw-addr 0.0.0.0

*Nov 21 21:19:58.299: OSPF-1 EXTER: Deleted external route 0.0.0.0/0.0.0.0

*Nov 21 21:19:58.303: OSPF-1 EXTER: Process partial nssa spf queue

 

Let's see what R1 will do by enabling the debugging:

 

R1 don't install default route from R3 since it is originating a default route with always keyword.

 

R1#debug ip ospf spf external

OSPF SPF external debugging is on

R1#

*Nov 21 21:19:58.855: OSPF-1 SPF  : Schedule partial SPF type 5, LSID 0.0.0.0, adv_rtr 3.3.3.3 area dummy area

*Nov 21 21:19:58.859: OSPF-1 SPF  : Service partial SPF, spf instance 43, 0/1/0

*Nov 21 21:19:58.859: OSPF-1 INTER: Process partial summary spf queue

*Nov 21 21:19:58.863: OSPF-1 EXTER: Process partial external spf queue

*Nov 21 21:19:58.863: OSPF-1 EXTER: Process partial spfQ: type 5, LSID 0.0.0.0, mask 0.0.0.0, adv_rtr 3.3.3.3, age 1, seq 0x80000001, area dummy area

*Nov 21 21:19:58.867: OSPF-1 EXTER: Start partial processing Type 5 External LSA 0.0.0.0, mask 0.0.0.0

*Nov 21 21:19:58.867: OSPF-1 EXTER:  adv_rtr 1.1.1.1, age 1281, seq 0x80000002, metric 1, metric-type 2, fw-addr 0.0.0.0

*Nov 21 21:19:58.871: OSPF-1 EXTER: Start partial processing Type 5 External LSA 0.0.0.0, mask 0.0.0.0

*Nov 21 21:19:58.871: OSPF-1 EXTER:  adv_rtr 3.3.3.3, age 1, seq 0x80000001, metric 1, metric-type 2, fw-addr 0.0.0.0

*Nov 21 21:19:58.875: OSPF-1 EXTER:    We originate defau

R1#lt always. Don't install default from others

*Nov 21 21:19:58.875: OSPF-1 EXTER: Process partial nssa spf queue

 

The LSA Type 5 advertised by R3 does not have a routing bit set therefore it is not considered for SPF calculation:

 

R1#show ip osp database  external adv-router 3.3.3.3

 

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

 

                Type-5 AS External Link States

 

  LS age: 476

  Options: (No TOS-capability, DC, Upward)

  LS Type: AS External Link

  Link State ID: 0.0.0.0 (External Network Number )

  Advertising Router: 3.3.3.3

  LS Seq Number: 80000001

  Checksum: 0xE0C5

  Length: 36

  Network Mask: /0

        Metric Type: 2 (Larger than any link state path)

        MTID: 0

        Metric: 1

        Forward Address: 0.0.0.0

        External Route Tag: 1

 

R1#

 

As a result R1 will never install a default route in its routing table:

 

R1#sh ip route 0.0.0.0

% Network not in table

R1#

 

R3 will install a default eigrp route through R2 because the LSA Type 5 advertised by R1 is ignored:

 

R3#show ip route eigrp | beg Gate

Gateway of last resort is 23.0.0.2 to network 0.0.0.0

 

D*EX  0.0.0.0/0 [170/156160] via 23.0.0.2, 00:00:25, FastEthernet0/0

R3#

 

To conclude : in order to prevent routing loop an OSPF router that originates a default route with always keyword will never accept other LSA Type 5 0.0.0.0 learned from another OSPF router.

 

Now what happen when R1 advertises a default route without the always keyword ?

 

Let's configure a static default route with an Administrative Distance 111 and we advertise it using the default-information originate command and enable debugging:

 

R1(config)#do debug ip ospf spf external

OSPF SPF external debugging is on

R1(config)#

 

R1(config)#ip route 0.0.0.0 0.0.0.0 lo0 111

R1(config)#router ospf 1

R1(config-router)#default-information originate

 

*Nov 21 22:05:45.839: OSPF-1 MON  : Schedule Full SPF in area 0, change in LSID 1.1.1.1, LSA type R

R1(config-router)#

*Nov 21 22:05:50.847: OSPF-1 EXTER: Started Building Type 5 External Routes

*Nov 21 22:05:50.847: OSPF-1 EXTER: Start processing Type 5 External LSA 0.0.0.0, mask 0.0.0.0

*Nov 21 22:05:50.847: OSPF-1 EXTER:  adv_rtr 3.3.3.3, age 798, seq 0x80000002, metric 1, metric-type 2, fw-addr 0.0.0.0

*Nov 21 22:05:50.851: OSPF-1 SPF  :    Add better path to LSA ID 0.0.0.0, gateway 13.0.0.3, dist 1

*Nov 21 22:05:50.851: OSPF-1 SPF  :    Add path: next-hop 13.0.0.3, interface FastEthernet0/0

*Nov 21 22:05:50.855: OSPF-1 EXTER: Route update succeeded for 0.0.0.0/0.0.0.0, next-hop FastEthernet0/0/13.0.0.3

*Nov 21 22:05:50.855: OSPF-1 EXTER: Started Building Type 7 External Routes

R1(config-router)#

*Nov 21 22:05:50.859: OSPF-1 EXTER: Entered External route sync for area dummy area

*Nov 21 22:05:50.859: OSPF-1 EXTER: Entered External route sync for area dummy area

*Nov 21 22:05:50.863: OSPF-1 EXTER: Entered NSSA route sync for area 0

*Nov 21 22:05:50.863: OSPF-1 EXTER: Entered NSSA route sync for area 0

 

R1(config-router)#do undebug all

All possible debugging has been turned off

R1(config-router)#

 

Let's verify the routing table of R1, of course now R1 installs the default LSA Type 5 learned from R3 in the routing table because the routing bit is set in the LSA Type 5's R3:

 

R1(config-router)#do show ip route | inc 0.0.0.0

Gateway of last resort is 13.0.0.3 to network 0.0.0.0

O*E2  0.0.0.0/0 [110/1] via 13.0.0.3, 00:07:38, FastEthernet0/0

R1(config-router)#

 

Notice the routing bit set on this LSA Type 5 originated from R3 so it allows R1 to install a default route:

 

R1#show ip ospf data external adv-router 3.3.3.3

 

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

 

                Type-5 AS External Link States

 

  Routing Bit Set on this LSA in topology Base with MTID 0

  LS age: 1012

  Options: (No TOS-capability, DC, Upward)

  LS Type: AS External Link

  Link State ID: 0.0.0.0 (External Network Number )

  Advertising Router: 3.3.3.3

  LS Seq Number: 80000002

  Checksum: 0xDEC6

  Length: 36

  Network Mask: /0

        Metric Type: 2 (Larger than any link state path)

        MTID: 0

        Metric: 1

        Forward Address: 0.0.0.0

        External Route Tag: 1

 

R1#

 

Now how R3 treats the LSA Type 5 advertised by R1 ?

 

From the debug output we can see that R1 sets the MAXAGE in its LSA Type 5 to 3600 and the max metric to 16777215, this prevent R3 to install the default route in order to avoid a routing loop:

 

R3#debug ip osp spf external

OSPF SPF external debugging is on

R3#

*Nov 21 21:54:52.227: OSPF-1 SPF  : Detect MAXAGE in LSA type 5, LS ID 0.0.0.0, from 1.1.1.1

*Nov 21 21:54:52.227: OSPF-1 SPF  : Detect generic change in LSA type 5, LSID 0.0.0.0, from 1.1.1.1 area 0

*Nov 21 21:54:52.231: OSPF-1 SPF  : Schedule partial SPF type 5, LSID 0.0.0.0, adv_rtr 1.1.1.1 area dummy area

*Nov 21 21:54:52.235: OSPF-1 SPF  : Service partial SPF, spf instance 48, 0/1/0

*Nov 21 21:54:52.235: OSPF-1 INTER: Process partial summary spf queue

*Nov 21 21:54:52.235: OSPF-1 EXTER: Process partial external spf queue

*Nov 21 21:54:52.239: OSPF-1 EXTER: Process partial spfQ: type 5, LSID 0.0.0.0, mask 0.0.0.0, adv_rtr 1.1.1.1, age 3600, seq 0x80000003, area dummy area

*Nov 21 21:54:52.239: OSPF-1 EXTER: Start partial processing Type 5 External LSA 0.0.0.0, mask 0.0.0.0

*Nov 21 21:54:52.243: OSPF-1 EXTER:  adv_rtr 1.1.1.1, age 3600, seq 0x80000003, metric 16777215, metric-type 2, fw-addr 0.0.0.0

*Nov 21 21:54:52.243: OSPF-1 EXTER:    We originate default always. D

R3#on't install default from others

*Nov 21 21:54:52.247: OSPF-1 EXTER: Start partial processing Type 5 External LSA 0.0.0.0, mask 0.0.0.0

*Nov 21 21:54:52.247: OSPF-1 EXTER:  adv_rtr 3.3.3.3, age 139, seq 0x80000002, metric 1, metric-type 2, fw-addr 0.0.0.0

*Nov 21 21:54:52.251: OSPF-1 EXTER: Process partial nssa spf queue

*Nov 21 21:54:52.691: OSPF-1 SPF  : Detect generic change in LSA type 1, LSID 1.1.1.1, from 1.1.1.1 area 0

*Nov 21 21:54:52.695: OSPF-1 MON  : Schedule Full SPF in area 0, change in LSID 1.1.1.1, LSA type R

R3#

 

Below we can see that R1 does not install an LSA Type 5 in its LSDB even if it is configured to redistribute a default route:

 

R1#show ip osp data external self-originate

 

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

R1#

 

R3#show ip route | inc 0.0.0.0

Gateway of last resort is 23.0.0.2 to network 0.0.0.0

D*EX  0.0.0.0/0 [170/156160] via 23.0.0.2, 00:39:46, FastEthernet0/0

R3#

 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: