MERAprojects / ops-quagga

GNU General Public License v2.0
0 stars 0 forks source link

OSPFv2: Kernel IP routing table misses gateways #32

Closed apolovin closed 7 years ago

apolovin commented 7 years ago

Problem Description:

Appliance: kernel IP routing table misses gateways for OSPFv2 routes.

OpenSwitch version:

openswitch-appliance-image-appliance-ops-0.4.0-master+2016101212

Test Topology:

screenshot

Steps to reproduce the problem:

1 Configure DUTs:

NODE OpenSwitch-1
hostname OpenSwitch-1
router ospf
    router-id 1.1.1.1
    network 10.0.0.0/30 area 0.0.0.0
    redistribute connected
interface eth1 
    no shutdown
    ip address 10.0.0.1/30
    ip ospf network point-to-point
interface eth2 
    no shutdown
    ip address 10.0.1.1/24
interface loopback 1
    ip address 1.1.1.1/32

NODE OpenSwitch-2
hostname OpenSwitch-2
router ospf
    router-id 2.2.2.2
    network 10.0.0.0/24 area 0.0.0.0
    redistribute connected
interface eth1 
    no shutdown
    ip address 10.0.0.2/30
    ip ospf network point-to-point
interface eth2 
    no shutdown
    ip address 10.0.2.1/24
interface loopback 1
    ip address 2.2.2.2/32

2 Check ovsdb routing table via show ip route:

OK, all routes are correct and contain valid next hop IP addresses.

OpenSwitch-1# show ip route

Displaying ipv4 routes selected for forwarding

'[x/y]' denotes [distance/metric]

1.1.1.1/32,  1 unicast next-hops 
    via  loopback1,  [0/0],  connected
10.0.0.0/30,  1 unicast next-hops 
    via  eth1,  [0/0],  connected
10.0.1.0/24,  1 unicast next-hops 
    via  eth2,  [0/0],  connected
10.0.2.0/24,  1 unicast next-hops 
    via  10.0.0.2,  [110/20],  ospf
2.2.2.2/32,  1 unicast next-hops 
    via  10.0.0.2,  [110/20],  ospf

OpenSwitch-2# show ip route

Displaying ipv4 routes selected for forwarding

'[x/y]' denotes [distance/metric]

1.1.1.1/32,  1 unicast next-hops 
    via  10.0.0.1,  [110/20],  ospf
10.0.0.0/30,  1 unicast next-hops 
    via  eth1,  [0/0],  connected
10.0.1.0/24,  1 unicast next-hops 
    via  10.0.0.1,  [110/20],  ospf
10.0.2.0/24,  1 unicast next-hops 
    via  eth2,  [0/0],  connected
2.2.2.2/32,  1 unicast next-hops 
    via  loopback1,  [0/0],  connected

3 Check kernel routing table via ip netns exec swns route:

NOK: all OSPF routes are displayed as directly connected, gateway IP addresses are missing.

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
2.2.2.2         *               255.255.255.255 UH    20     0        0 eth1
10.0.0.0        *               255.255.255.252 U     0      0        0 eth1
10.0.1.0        *               255.255.255.0   U     0      0        0 eth2
10.0.2.0        *               255.255.255.0   U     20     0        0 eth1

OpenSwitch-2# ip netns exec swns route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
1.1.1.1         *               255.255.255.255 UH    20     0        0 eth1
10.0.0.0        *               255.255.255.252 U     0      0        0 eth1
10.0.1.0        *               255.255.255.0   U     20     0        0 eth1
10.0.2.0        *               255.255.255.0   U     0      0        0 eth2
apolovin commented 7 years ago

https://tree.taiga.io/project/openswitch/issue/1978

xivamar commented 7 years ago

Fix for OSPFv2: Kernel IP routing table misses gateways https://github.com/MERAprojects/ops-quagga/pull/33