03-29-2023 08:49 AM - edited 03-30-2023 08:50 AM
So there is my setup (IOS-XR 7.2.2):
Nice and simple. Running OSPF between them.
This is the config:
hostname R1
!
interface Loopback0
ipv4 address 10.1.1.1 255.255.255.255
!
!
interface GigabitEthernet0/0/0/0
ipv4 address 192.168.1.1 255.255.255.0
!
router ospf CORE
log adjacency changes detail
router-id 10.1.1.1
redistribute connected tag 44
area 0
interface Loopback0
!
interface GigabitEthernet0/0/0/0
!
!
hostname R2
!
interface Loopback0
ipv4 address 10.2.2.2 255.255.255.255
!
interface GigabitEthernet0/0/0/0
ipv4 address 192.168.1.2 255.255.255.0
!
router ospf CORE
log adjacency changes detail
router-id 10.2.2.2
redistribute connected tag 44
area 0
interface Loopback0
!
interface GigabitEthernet0/0/0/0
!
!
Very basic. Nothing too flashy.
The neighborship comes up but there is no Type 5 LSA for the loopbacks that are being redistributed. Now I know that in this tiny lab the Type 1 LSA would be the primary source for each router to the reach the loopback of the other (as an intra area route). But I would at least expect the Type 5 LSA to be there. But I can only see the Type 5s for the connected interface:
RP/0/RP0/CPU0:R1#sh ospf database external | inc "State|Advert"
Wed Mar 29 15:35:07.604 UTC
Type-5 AS External Link States
Link State ID: 192.168.1.0 (External Network Number)
Advertising Router: 10.1.1.1
Link State ID: 192.168.1.0 (External Network Number)
Advertising Router: 10.2.2.2
RP/0/RP0/CPU0:R1#
So... I thought, let's disable OSPF on the loopbacks. And voila! The Type 5's show up....
RP/0/RP0/CPU0:R1#conf t
Wed Mar 29 15:35:42.626 UTC
RP/0/RP0/CPU0:R1(config)#router ospf CORE
RP/0/RP0/CPU0:R1(config-ospf)#area 0
RP/0/RP0/CPU0:R1(config-ospf-ar)#no int lo0
RP/0/RP0/CPU0:R1(config-ospf-ar)#commit
Wed Mar 29 15:35:55.544 UTC
RP/0/RP0/CPU0:R1(config-ospf-ar)#
RP/0/RP0/CPU0:R1#
RP/0/RP0/CPU0:R1#sh ospf database external | inc "State|Advert"
Wed Mar 29 15:35:58.485 UTC
Type-5 AS External Link States
Link State ID: 10.1.1.1 (External Network Number). <<<<<<<<<<<<<<<
Advertising Router: 10.1.1.1
Link State ID: 192.168.1.0 (External Network Number)
Advertising Router: 10.1.1.1
Link State ID: 192.168.1.0 (External Network Number)
Advertising Router: 10.2.2.2
RP/0/RP0/CPU0:R1#
So I figure the rule is:
For loopbacks, do not redistribute if they are already enabled on the current OSPF routing process.
Next I reversed the above change:
RP/0/RP0/CPU0:R1#rollback configuration last 1
Wed Mar 29 15:37:23.821 UTC
Loading Rollback Changes.
Loaded Rollback Changes in 1 sec
Committing.
6 items committed in 1 sec
Updating.
Updated Commit database in 1 sec
Configuration successfully rolled back 1 commits.
RP/0/RP0/CPU0:R1#
And then wanted to play with loopbacks that were not /32s - since we know OSPF defaults to sending a /32 without the `loopback stub-network enable` command. So I did this:
RP/0/RP0/CPU0:R1(config)#int lo0
RP/0/RP0/CPU0:R1(config-if)#ip address 10.1.1.1/24
RP/0/RP0/CPU0:R1(config-if)#commit
Wed Mar 29 15:39:30.294 UTC
RP/0/RP0/CPU0:R1(config-if)#
RP/0/RP0/CPU0:R1#
But now I get two Type 5-LSAs. One with a /24 and one with a /32.
RP/0/RP0/CPU0:R1#sh ospf database external | inc "State|Advert|Mask"
Wed Mar 29 15:40:26.018 UTC
Type-5 AS External Link States
Link State ID: 10.1.1.0 (External Network Number) <<<<<<<<<< (/24)
Advertising Router: 10.1.1.1
Network Mask: /24
Link State ID: 10.1.1.1 (External Network Number) <<<<<<<<<< (/32)
Advertising Router: 10.1.1.1
Network Mask: /32
Link State ID: 192.168.1.0 (External Network Number)
Advertising Router: 10.1.1.1
Network Mask: /24
Link State ID: 192.168.1.0 (External Network Number)
Advertising Router: 10.2.2.2
Network Mask: /24
RP/0/RP0/CPU0:R1#
This clearly violated the rule I thought I'd figured out above. The Type 1 LSA, as expect, still only advertises the /32 (until I put `loopback stub-network enable`). I won't show that. I'm more concerned about what the rules are for redistribution in this case. The best I can come up with is...
If a /32 network is on a loopback and that loopback is enabled for OSPF, then any configured redistribution will do nothing UNLESS you change that loopback to something that is not a /32, in which case TWO Type 5 LSAs will be created, one for the /32 and one for the other mask length (in this case /24)
This seems way too convoluted and I feel like I'm missing something. Can anyone help?
PS. As a bonus problem, if I do enter `loopback stub-network enable` on the loopback under OSPF, I would have expected the /32 Type 5 LSA to disappear. But it doesn't.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide