MERAprojects / ops-build

Other
0 stars 0 forks source link

iBGP routes aren't added in ip route table #14

Open xivamar opened 7 years ago

xivamar commented 7 years ago

Problem Description:

iBGP routes are not added in ip route table.

OpenSwitch version:

OpenSwitch 0.4.0 (Build: appliance-ops-0.4.0-devel/master-20161216101716-dev)

Test Topology:

screenshot

Steps to reproduce the problem (see attached file):

  1. Configure DUTs as in attached file.
  2. Check adjacency and bgp routing table on DUT1. All routes should be in the tables.

      switch# show ip bgp summary 
      BGP router identifier 1.1.1.1, local AS number 77
      RIB entries 2
      Peers 2
    
      Neighbor             AS MsgRcvd MsgSent Up/Down  State
      2.2.2.2              77     295     297 04:51:03 Established
      3.3.3.3              77     296     297 04:51:04 Established
      switch# 
      switch# 
      switch# show ip bgp         
      Status codes: s suppressed, d damped, h history, * valid, > best, = multipath,
                    i internal, S Stale, R Removed
      Origin codes: i - IGP, e - EGP, ? - incomplete
    
      Local router-id 1.1.1.1
         Network          Next Hop            Metric LocPrf Weight Path
      *> 11.1.11.0/30     0.0.0.0                  0      0  32768  i
      *>i13.1.32.0/30     3.3.3.3                  0    100      0  i
      Total number of entries 2
      switch# 
  3. Check adjacency and bgp routing table on DUT3. All routes should be in the tables.

      switch# show ip bgp summary 
      BGP router identifier 3.3.3.3, local AS number 77
      RIB entries 2
      Peers 2
    
      Neighbor             AS MsgRcvd MsgSent Up/Down  State
      1.1.1.1              77     298     300 04:54:58 Established
      2.2.2.2              77     297     300 04:54:15 Established
      switch# 
      switch# 
      switch# show ip bgp         
      Status codes: s suppressed, d damped, h history, * valid, > best, = multipath,
                    i internal, S Stale, R Removed
      Origin codes: i - IGP, e - EGP, ? - incomplete
    
      Local router-id 3.3.3.3
         Network          Next Hop            Metric LocPrf Weight Path
      *>i11.1.11.0/30     1.1.1.1                  0    100      0  i
      *> 13.1.32.0/30     0.0.0.0                  0      0  32768  i
      Total number of entries 2
      switch# 
  4. Check routing table on DUT1 and DUT3. - NOK: routing table doesn't contain BGP routes. on DUT1:

     switch# 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.1.12.0/30,  1 unicast next-hops 
        via  eth1,  [0/0],  connected
     10.1.23.0/30,  1 unicast next-hops 
        via  10.1.12.2,  [110/20],  ospf
     11.1.11.0/30,  1 unicast next-hops 
        via  eth2,  [0/0],  connected
     2.2.2.2/32,  1 unicast next-hops 
        via  10.1.12.2,  [110/20],  ospf
     3.3.3.3/32,  1 unicast next-hops 
        via  10.1.12.2,  [110/30],  ospf
     switch# 
     switch# 
     switch# show rib 
     Displaying ipv4 rib entries 
     '*' denotes selected
     '[x/y]' denotes [distance/metric]
    
     *1.1.1.1/32,  1 unicast next-hops 
        *via  loopback1,  [0/0],  connected
     1.1.1.1/32,  1 unicast next-hops 
        *via  loopback1,  [110/4000],  ospf
     *10.1.12.0/30,  1 unicast next-hops 
        *via  eth1,  [0/0],  connected
     10.1.12.0/30,  1 unicast next-hops 
        *via  eth1,  [110/41],  ospf
     *10.1.23.0/30,  1 unicast next-hops 
        *via  10.1.12.2,  [110/20],  ospf
     *11.1.11.0/30,  1 unicast next-hops 
        *via  eth2,  [0/0],  connected
     13.1.32.0/30,  1 unicast next-hops 
        via  3.3.3.3,  [200/0],  bgp
     *2.2.2.2/32,  1 unicast next-hops 
        *via  10.1.12.2,  [110/20],  ospf
     *3.3.3.3/32,  1 unicast next-hops 
        *via  10.1.12.2,  [110/30],  ospf
     No ipv6 rib entries 
     switch#

    on DUT3:

     root@switch:~# ip netns exec swns ip route 
     1.1.1.1 via 10.1.23.2 dev eth2  proto zebra  metric 30 
     2.2.2.2 via 10.1.23.2 dev eth2  proto zebra  metric 20 
     10.1.12.0/30 via 10.1.23.2 dev eth2  proto zebra  metric 20 
     10.1.23.0/30 dev eth2  proto kernel  scope link  src 10.1.23.1 
     13.1.32.0/30 dev eth1  proto kernel  scope link  src 13.1.32.1 
     root@switch:~# 
     root@switch:~# 
     root@switch:~# /usr/bin/ovsdb-client dump OpenSwitch Route prefix selected
     Route table
     prefix         selected
     -------------- --------
     "1.1.1.1/32"   true    
     "10.1.12.0/30" true    
     "10.1.23.0/30" []      
     "10.1.23.0/30" true    
     "11.1.11.0/30" false   
     "13.1.32.0/30" true    
     "2.2.2.2/32"   true    
     "3.3.3.3/32"   []      
     "3.3.3.3/32"   true    
     root@switch:~# 
  5. Try to send ping from PC1 to PC2 and vice versa. - NOK: Ping is absent.

iBGP_small.txt

mfirulin commented 7 years ago

The function rib_process in the module zebra skips these routes because their next hops are not connected to the corresponding switch and considered "unreachable". The function nexthop_active_ipv4 just passes such next hops (type ZEBRA_ROUTE_OSPF).