FRRouting / frr

The FRRouting Protocol Suite
https://frrouting.org/
Other
3.21k stars 1.24k forks source link

OSPFv2 - Network statement only matches when shorter or equal prefix lengths are used #736

Closed jhiggins-NZ closed 7 years ago

jhiggins-NZ commented 7 years ago

Issue:

. .

Expected Behaviour:

. .

Version:

. .

Example of the Issue:

interface eth0
 ip address 192.168.24.2/24
 ip ospf network point-to-point
!
interface eth1
 ip address 192.168.26.2/24
 ip ospf network point-to-point
!
interface eth2
 ip address 192.168.102.2/24
!
interface eth3
 ip address 192.168.23.2/24
!
interface eth4
 ip address 192.168.112.2/24
!
interface lo
 ip address 2.2.2.2/32
!
router ospf
 ospf router-id 2.2.2.2
 network 2.2.2.2/32 area 0
 network 192.168.23.2/32 area 4
 network 192.168.24.2/32 area 0
 network 192.168.26.2/32 area 0
 network 192.168.102.2/32 area 5
 network 192.168.112.2/32 area 3

.
.

**Interfaces are all missing from OSPF processing.
Only Loopback interface with the same prefix length is matched.**

vLSR-R2# show ip ospf interface
lo is up
  ifindex 1, MTU 65536 bytes, BW 0 Mbit <UP,LOOPBACK,RUNNING>
  Internet Address 2.2.2.2/32, Area 0.0.0.0
  MTU mismatch detection:enabled
  Router ID 2.2.2.2, Network Type LOOPBACK, Cost: 10
  Transmit Delay is 1 sec, State Loopback, Priority 1
  No backup designated router on this network
  Multicast group memberships: <None>
  Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
    Hello due in inactive
  Neighbor Count is 0, Adjacent neighbor count is 0

.
.

**Changing the prefix length to a /32 host prefix length.**

vLSR-R2(config)# interface eth3
vLSR-R2(config-if)# no ip address 192.168.23.2/24
vLSR-R2(config-if)# ip address 192.168.23.2/32
vLSR-R2(config-if)#
vLSR-R2(config-if)# do sh ip ospf interface
eth3 is up
  ifindex 5, MTU 1500 bytes, BW 0 Mbit <UP,BROADCAST,RUNNING,MULTICAST>
  This interface is UNNUMBERED, Area 0.0.0.4 [NSSA]
  MTU mismatch detection:enabled
  Router ID 2.2.2.2, Network Type BROADCAST, Cost: 10
  Transmit Delay is 1 sec, State Waiting, Priority 1
  No backup designated router on this network
  Multicast group memberships: OSPFAllRouters
  Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
    Hello due in 5.124s
  Neighbor Count is 0, Adjacent neighbor count is 0
lo is up
  ifindex 1, MTU 65536 bytes, BW 0 Mbit <UP,LOOPBACK,RUNNING>
  Internet Address 2.2.2.2/32, Area 0.0.0.0
  MTU mismatch detection:enabled
  Router ID 2.2.2.2, Network Type LOOPBACK, Cost: 10
  Transmit Delay is 1 sec, State Loopback, Priority 1
  No backup designated router on this network
  Multicast group memberships: <None>
  Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
    Hello due in inactive
  Neighbor Count is 0, Adjacent neighbor count is 0

**Now the interface is enabled for OSPF processing.**

. .

Example - OSPF will match on shorter prefix lengths.

vLSR-R2(config)# router ospf
vLSR-R2(config-router)# network 192.168.0.0/16 area 66
vLSR-R2(config-router)# end
vLSR-R2#
vLSR-R2# show ip ospf interface
eth0 is up
  ifindex 2, MTU 1500 bytes, BW 0 Mbit <UP,BROADCAST,RUNNING,MULTICAST>
  Internet Address 192.168.24.2/24, Broadcast 192.168.24.255, Area 0.0.0.66
  MTU mismatch detection:enabled
  Router ID 2.2.2.2, Network Type POINTOPOINT, Cost: 10
  Transmit Delay is 1 sec, State Point-To-Point, Priority 1
  No backup designated router on this network
  Multicast group memberships: OSPFAllRouters
  Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
    Hello due in 4.379s
  Neighbor Count is 0, Adjacent neighbor count is 0
eth1 is up
  ifindex 3, MTU 1500 bytes, BW 0 Mbit <UP,BROADCAST,RUNNING,MULTICAST>
  Internet Address 192.168.26.2/24, Broadcast 192.168.26.255, Area 0.0.0.66
  MTU mismatch detection:enabled
  Router ID 2.2.2.2, Network Type POINTOPOINT, Cost: 10
  Transmit Delay is 1 sec, State Point-To-Point, Priority 1
  No backup designated router on this network
  Multicast group memberships: OSPFAllRouters
  Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
    Hello due in 4.379s
  Neighbor Count is 0, Adjacent neighbor count is 0
eth2 is up
  ifindex 4, MTU 1500 bytes, BW 0 Mbit <UP,BROADCAST,RUNNING,MULTICAST>
  Internet Address 192.168.102.2/24, Broadcast 192.168.102.255, Area 0.0.0.66
  MTU mismatch detection:enabled
  Router ID 2.2.2.2, Network Type BROADCAST, Cost: 10
  Transmit Delay is 1 sec, State Waiting, Priority 1
  No backup designated router on this network
  Multicast group memberships: OSPFAllRouters
  Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
    Hello due in 4.379s
  Neighbor Count is 0, Adjacent neighbor count is 0
eth3 is up
  ifindex 5, MTU 1500 bytes, BW 0 Mbit <UP,BROADCAST,RUNNING,MULTICAST>
  This interface is UNNUMBERED, Area 0.0.0.4 [NSSA]
  MTU mismatch detection:enabled
  Router ID 2.2.2.2, Network Type BROADCAST, Cost: 10
  Transmit Delay is 1 sec, State DR, Priority 1
  No backup designated router on this network
  Multicast group memberships: OSPFAllRouters OSPFDesignatedRouters
  Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
    Hello due in 0.847s
  Neighbor Count is 0, Adjacent neighbor count is 0
eth4 is up
  ifindex 6, MTU 1500 bytes, BW 0 Mbit <UP,BROADCAST,RUNNING,MULTICAST>
  Internet Address 192.168.112.2/24, Broadcast 192.168.112.255, Area 0.0.0.66
  MTU mismatch detection:enabled
  Router ID 2.2.2.2, Network Type BROADCAST, Cost: 10
  Transmit Delay is 1 sec, State Waiting, Priority 1
  No backup designated router on this network
  Multicast group memberships: OSPFAllRouters
  Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
    Hello due in 4.382s
  Neighbor Count is 0, Adjacent neighbor count is 0
lo is up
  ifindex 1, MTU 65536 bytes, BW 0 Mbit <UP,LOOPBACK,RUNNING>
  Internet Address 2.2.2.2/32, Area 0.0.0.0
  MTU mismatch detection:enabled
  Router ID 2.2.2.2, Network Type LOOPBACK, Cost: 10
  Transmit Delay is 1 sec, State Loopback, Priority 1
  No backup designated router on this network
  Multicast group memberships: <None>
  Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
    Hello due in inactive
  Neighbor Count is 0, Adjacent neighbor count is 0
ne-vlezay80 commented 7 years ago

Please show output to command: sh ip route

jhiggins-NZ commented 7 years ago

Sure

vLSR-R2# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, P - PIM, N - NHRP, T - Table,
       v - VNC, V - VNC-Direct,
       > - selected route, * - FIB route

O   2.2.2.2/32 [110/0] is directly connected, lo, 12:52:51
C>* 2.2.2.2/32 is directly connected, lo
C>* 192.168.23.0/24 is directly connected, eth3
C>* 192.168.24.0/24 is directly connected, eth0
C>* 192.168.26.0/24 is directly connected, eth1
C>* 192.168.102.0/24 is directly connected, eth2
C>* 192.168.112.0/24 is directly connected, eth4
ne-vlezay80 commented 7 years ago

Please show output command: sh ip ospf route

jhiggins-NZ commented 7 years ago

Here it is.

In fact I found this issue also on a proprietary continuation of Zebra for RIP - so ill test that later too, as it may still be present through the Quagga -> FRR continuation.

vLSR-R2# show ip ospf route
============ OSPF network routing table ============
N    2.2.2.2/32            [0] area: 0.0.0.0
                           directly attached to lo

============ OSPF router routing table =============

============ OSPF external routing table ===========
donaldsharp commented 7 years ago

This should work, waiting for a volunteer to work on

dslicenc commented 7 years ago

Assign to me. I already have a fix for it I'm testing

donaldsharp commented 7 years ago

PR #763 was merged in