FRRouting / frr

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

[FreeBSD] - static routes are not set after raising the interface #3937

Open pautiina opened 5 years ago

pautiina commented 5 years ago

Things you may try first

Description

I have use mpd5 for l2tp tunnel connection to my server and create static route for remote client. After client reconnect - static routes disappear from the system kernel, but remain in the FRR

In the master branch, static routes are not installed at all on these interfaces.

Steps to Reproduce

1.

[root@noc /]# ifconfig ng4
ng4: flags=88d1<UP,POINTOPOINT,RUNNING,NOARP,SIMPLEX,MULTICAST> metric 0 mtu 1446
        inet 10.17.0.1 --> 10.17.0.7 netmask 0xffffffff
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
[root@noc /]# route get 10.0.30.0
   route to: 10.0.30.0
destination: 10.0.30.0
       mask: 255.255.255.0
    gateway: 10.17.0.7
        fib: 0
  interface: ng4
      flags: <UP,GATEWAY,DONE,PROTO1>
 recvpipe  sendpipe  ssthresh  rtt,msec    mtu        weight    expire
       0         0         0         0      1446         1         0
[root@noc /]#
[root@noc /]# vtysh -c "show ip route 10.0.30.0/24 longer-prefixes"
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR,
       > - selected route, * - FIB route

S>* 10.0.30.0/24 [1/0] via 10.17.0.7, ng4, 00:23:51
[root@noc /]#
  1. [root@noc /]# /usr/local/etc/rc.d/mpd5 restart
    Stopping mpd5.
    Waiting for PIDS: 69677.
    Starting mpd5.
    [root@noc /]#
    [root@noc /]#  route get 10.0.30.0
    route to: 10.0.30.0
    destination: default
       mask: default
    gateway: gate
        fib: 0
    interface: vtnet0
      flags: <UP,GATEWAY,DONE,STATIC>
    recvpipe  sendpipe  ssthresh  rtt,msec    mtu        weight    expire
       0         0         0         0      1500         1         0
    [root@noc /]#
    
    [root@noc /]# vtysh -c "show ip route 10.0.30.0/24 longer-prefixes"
    Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR,
       > - selected route, * - FIB route

S>* 10.0.30.0/24 [1/0] via 10.17.0.7, ng4, 00:01:34 [root@noc /]#

3. 

[root@noc /]# /usr/local/etc/rc.d/frr restart Stopping staticd. Waiting for PIDS: 95172. Stopping ospfd. Waiting for PIDS: 95166. Stopping zebra. Waiting for PIDS: 95160. Checking zebra.conf

2019/03/13 10:23:10 warnings: ZEBRA: warning: connected_add_ipv6 called for interface ng0 with peer flag set, but no peer address supplied 2019/03/13 10:23:10 warnings: ZEBRA: warning: connected_add_ipv6 called for interface ng1 with peer flag set, but no peer address supplied 2019/03/13 10:23:10 warnings: ZEBRA: warning: connected_add_ipv6 called for interface ng3 with peer flag set, but no peer address supplied 2019/03/13 10:23:10 warnings: ZEBRA: warning: connected_add_ipv6 called for interface ng4 with peer flag set, but no peer address supplied 2019/03/13 10:23:10 warnings: ZEBRA: Disabling MPLS support (no kernel support) OK Starting zebra. 2019/03/13 10:23:10 warnings: ZEBRA: warning: connected_add_ipv6 called for interface ng0 with peer flag set, but no peer address supplied 2019/03/13 10:23:10 warnings: ZEBRA: warning: connected_add_ipv6 called for interface ng1 with peer flag set, but no peer address supplied 2019/03/13 10:23:10 warnings: ZEBRA: warning: connected_add_ipv6 called for interface ng3 with peer flag set, but no peer address supplied 2019/03/13 10:23:10 warnings: ZEBRA: warning: connected_add_ipv6 called for interface ng4 with peer flag set, but no peer address supplied 2019/03/13 10:23:10 warnings: ZEBRA: Disabling MPLS support (no kernel support) Checking ospfd.conf OK Starting ospfd. Checking staticd.conf OK Starting staticd. [root@noc /]# route get 10.0.30.0 route to: 10.0.30.0 destination: 10.0.30.0 mask: 255.255.255.0 gateway: 10.17.0.7 fib: 0 interface: ng4 flags: <UP,GATEWAY,DONE,PROTO1> recvpipe sendpipe ssthresh rtt,msec mtu weight expire 0 0 0 0 1446 1 0 [root@noc /]#


**Expected behavior:**
Routes must be returned to the kernel fib after tunnel interfaces reconnect

**Actual behavior:**
Routes remain in the FRR, but they do not install on kernel fib

### Components
[staticd]

### Versions
* OS: [name] [version]
* Kernel: [BSD] [12.0]
* FRR: [6.2]

### Attachments

2019/03/13 09:56:33 ZEBRA: kernel_rtm_ipv4: 10.0.41.0/24: rtm_write() unexpectedly returned -4 for command RTM_DELETE 2019/03/13 09:56:33 ZEBRA: kernel_rtm_ipv4: 172.16.5.0/24: rtm_write() unexpectedly returned -4 for command RTM_DELETE 2019/03/13 09:56:33 ZEBRA: vrf_if_ioctl(SIOCGIFFLAGS) failed: Device not configured 2019/03/13 09:56:33 ZEBRA: vrf_if_ioctl(SIOCGIFFLAGS) failed: Device not configured 2019/03/13 09:56:33 ZEBRA: Can't lookup mtu by ioctl(SIOCGIFMTU) 2019/03/13 09:56:33 ZEBRA: vrf_if_ioctl(SIOCGIFFLAGS) failed: Device not configured 2019/03/13 09:56:33 ZEBRA: vrf_if_ioctl(SIOCGIFFLAGS) failed: Device not configured 2019/03/13 09:56:33 ZEBRA: Can't lookup mtu by ioctl(SIOCGIFMTU) 2019/03/13 09:56:33 ZEBRA: vrf_if_ioctl(SIOCGIFFLAGS) failed: Device not configured 2019/03/13 09:56:33 ZEBRA: vrf_if_ioctl(SIOCGIFFLAGS) failed: Device not configured 2019/03/13 09:56:33 ZEBRA: Can't lookup mtu by ioctl(SIOCGIFMTU) 2019/03/13 09:56:33 ZEBRA: vrf_if_ioctl(SIOCGIFFLAGS) failed: Device not configured 2019/03/13 09:56:33 ZEBRA: Can't lookup mtu by ioctl(SIOCGIFMTU) 2019/03/13 09:56:33 ZEBRA: vrf_if_ioctl(SIOCGIFFLAGS) failed: Device not configured 2019/03/13 09:56:33 ZEBRA: vrf_if_ioctl(SIOCGIFFLAGS) failed: Device not configured 2019/03/13 09:56:33 ZEBRA: Can't lookup mtu by ioctl(SIOCGIFMTU) 2019/03/13 09:56:39 ZEBRA: warning: connected_add_ipv6 called for interface ng0 with peer flag set, but no peer address supplied 2019/03/13 09:56:40 ZEBRA: warning: connected_add_ipv6 called for interface ng1 with peer flag set, but no peer address supplied 2019/03/13 09:56:41 ZEBRA: warning: connected_add_ipv6 called for interface ng2 with peer flag set, but no peer address supplied 2019/03/13 09:56:43 ZEBRA: warning: connected_add_ipv6 called for interface ng3 with peer flag set, but no peer address supplied 2019/03/13 09:57:01 ZEBRA: Client 'static' encountered an error and is shutting down.

vgrebenschikov commented 3 years ago

See #9188 - once configured interface my provide either connected routes (set with ifconfig) or kernel routes (set by hands with some interface configuration script)

Contrary - static routes - something configured by by administrator in vtysh

but patch above fixes only case when there are no gateway IP on such routes