Peculiar route in systemd-networkd netstat

BSP 5.2 – system with four VLANs attached to switch. eth0.3 is the “outside world”. Address is static (10.5.32.80/21, gateway 10.5.32.1).

I am seeing a weird line with destination 0.0.0.0 gateway 0.0.0.0 being added sometimes. I never saw this with BSP 2.8. The host routes are being added from our DHCP system even though DHCP is not selected… this could be related. Also, DNS works even though no DNS server is configured. It’s like the Linux 5 networking kernel is using DHCP in addition to the static IP in the network file…

root:~# netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         0.0.0.0         0.0.0.0         U         0 0          0 eth0.2
0.0.0.0         10.5.39.21      0.0.0.0         UG        0 0          0 eth0.3
10.1.1.0        0.0.0.0         255.255.255.0   U         0 0          0 eth0.4
10.5.16.220     10.5.32.1       255.255.255.255 UGH       0 0          0 eth0.3
10.5.32.0       0.0.0.0         255.255.248.0   U         0 0          0 eth0.3
10.5.32.1       0.0.0.0         255.255.255.255 UH        0 0          0 eth0.3
10.240.248.55   10.5.32.1       255.255.255.255 UGH       0 0          0 eth0.3
10.242.248.55   10.5.32.1       255.255.255.255 UGH       0 0          0 eth0.3
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0.2
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0.4
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0
192.168.10.0    0.0.0.0         255.255.255.0   U         0 0          0 eth0.2
192.168.66.0    0.0.0.0         255.255.255.0   U         0 0          0 eth0

The command

route del -net 0.0.0.0 gw 0.0.0.0 netmask 0.0.0.0 dev eth0.2

Does not delete it…

I know this is bizarre, but does anybody have any idea where to start looking for why?

If this happens on the interface that’s connected to the building LAN, then until the a gateway is re-added manually, the system can’t get to the internet. Very weird.

I can supply my /etc/systemd/network files as well if this will help.

Hi, @dgribben

Could you give some more details?

  • Did you build the OS that you’re using? If yes, what changes you did?
  • Can you reproduce the problem using a reference unmodified image?
  • If you connect your module to a network without any DHCP service running, do you see the same problem happening?

Sure. Yes, I built the image – the big change is I set the network manager to networkmanager instead of connman (which may be part of the issue). The reference image uses connman, which changes the situation too much to be useful. And, no, the problem is unique to a network with DHCP running, if there is no DHCP service nothing odd happens. I’m just trying to figure out why a static IP LAN is picking up advertised extra routing information from the network.

This is not a critical issue because my customer found a workaround but it’s strange.

Below is the altered part of my local.conf file.

DISTRO_FEATURES_append = " systemd x11vnc zeroconf rng-tools opengl"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
VIRTUAL-RUNTIME_init_manager = "systemd"
VIRTUAL-RUNTIME_initscripts = ""
IMX_DEFAULT_DISTRO_FEATURES_append = " systemd"
CORE_IMAGE_EXTRA_INSTALL += "dhcp-server"

# set networkmanager as default config
PREFERRED_RPROVIDER_network-configuration = "networkmanager"
TOOLCHAIN_TARGET_TASK_append = " kernel-devsrc"

IMAGE_INSTALL_append = " apache2 php php-cli mariadb mysql5 net-snmp-dev lrzsz dosfstools opkg qtdeclarative-qmlplugins qtquickcontrols-qmlplugins ntpdate subversion inetutils atftpd atftp nfs-utils-client postfix dpkg apt nodejs nodejs-npm tcf-agent openssh-sftp-server avahi-utils rpm dialog mysql5-client mysql5-leftovers util-linux rng-tools smartmontools ruby "


#IMAGE_INSTALL_remove = "eglinfo-x11"

EXTRA_IMAGE_FEATURES = " \
    debug-tweaks \
    tools-debug \
    eclipse-debug \
    "

PACKAGECONFIG_GL_pn-qtbase = "gles2"
# TRY ME
#MACHINEOVERRIDES = ":use-mainline-bsp"

TOOLCHAIN_TARGET_TASK_append = " kernel-devsrc"

# This file does not need to exist, if it does it can be used to influence machine specific
# configurations without copying the machine file.
include conf/machine/include/${MACHINE}.inc

It is VERY possible that connman.service is still running despite it being removed by the local.conf file… in fact, that’s what is happening. I have disabled the service and so far that appears to be the issue.

Hi, @dgribben

You set to use networkmanager instead connman, but would be possible that some connman service is still running? Did you remove any connman packages? I think this is worth a try.

Also, how you configured your module to be static IP? Can you show?

About the impossibility of the route removal, when you execute route del -net 0.0.0.0 gw 0.0.0.0 netmask 0.0.0.0 dev eth0.2, what is the output?

And a side question: you are installing dhcp-server on the image, but you are connecting the module on a network that have already a DHCP server running. Although it is not forbidden, is it desired?