1

I’m using a Beaglebone Black running a webserver on a Debian system. The BBB is working as a DHCP + DNS (using dnsmasq) in a local network (192.168.5.xyz) with no direct internet access. I can easily connect devices that retrieve an IP from the BBB. So far so good.

In case I’m at home for example, I’d like to add internet access to this little network. So I connect this network to a router that provides internet access and has a static IP address (192.168.5.254) within this network. So I added the router’s IP to the /etc/network/interfaces file:

/etc/network/interfaces:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#auto eth0
#iface eth0 inet dhcp

allow-hotplug eth0
iface eth0 inet static
address 192.168.5.1
netmask 255.255.255.0
gateway 192.168.5.254

But for some reason an extra default routing entry is added whenever I reboot my BBB. When I manually delete/flush the default entry with GW 0.0.0.0 everything works fine.

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         0.0.0.0         0.0.0.0         U     0      0        0 eth0
default         192.168.5.254   0.0.0.0         UG    0      0        0 eth0
link-local      0.0.0.0         255.255.0.0     U     0      0        0 eth0
192.168.5.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0

It seems that the unwanted default gateway is added during boot: journalctl -b:

…
Nov 06 11:29:40 webserver connmand[1827]: eth0 {add} address 192.168.5.1/24 label eth0 family 2
Nov 06 11:29:40 webserver avahi-daemon[1792]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.5.1.
Nov 06 11:29:40 webserver connmand[1827]: eth0 {add} route 192.168.5.0 gw 0.0.0.0 scope 253 <LINK>
Nov 06 11:29:40 webserver avahi-daemon[1792]: New relevant interface eth0.IPv4 for mDNS.
Nov 06 11:29:40 webserver avahi-daemon[1792]: Registering new address record for 192.168.5.1 on eth0.IPv4.
Nov 06 11:29:40 webserver connmand[1827]: eth0 {add} route 0.0.0.0 gw 192.168.5.254 scope 0 <UNIVERSE>
…

I can also the the "wanted" routings I made in /etc/network/interfaces. These are also made by the Connman Deamon. But the /etc/connman/main.conf is apparently not the file that is causing the default route with gateway 0.0.0.0:

[General]
PreferredTechnologies=ethernet,wifi
SingleConnectedTechnology=false
AllowHostnameUpdates=false
PersistentTetheringMode=true
NetworkInterfaceBlacklist=SoftAp0,usb0,usb1

Do you have any hints how to find out where the extra route is added and how to prevent it? I've already looked through several sripts that are called during boot but couldn't find it... Or is the way I'm setting up eth0 completely wrong?

1 Answer 1

3

You see the route is added by connmand (ConnMan daemon). It's not related to the normal interfaces settings but a separate config. If You cannot disable it completely (don't know whether it's needed for Your BBB what ever the hell that is) You have to look at that's configuration. If You would post that configuration and tell for which job connman is needed someone could assist You further.


The solution in this case was simply disabling connman to handle eth0 by changing the last line of /etc/connman/main.conf to NetworkInterfaceBlacklist=eth0,SoftAp0,usb0,usb1.
That changed the output of route to:

Kernel IP routing table
Destination    Gateway        Genmask        Flags  Metric Ref  Use  Iface
default        192.168.5.254  0.0.0.0        UG     0      0    0    eth0
192.168.5.0    0.0.0.0        255.255.255.0  U      0      0    0    eth0

With that everything seems to work fine.

5
  • EOhm, thank you for your response! I checked the /etc/connman/main.conf but couldn't find anything the leads to the issue. I added the content of that file in my original post. The other routings that I put in the /etc/network/interfaces are obviously also set by the Connman Deamon during boot-up. Sorry, BBB is the Beaglebone Black single board computer that I'm using.
    – tsc6666
    Commented Nov 12, 2019 at 7:51
  • Why obviously? You did not show that. The files are not for connman. Possibly it uses them but it has it's own independent configuration. Can You disable the connman at all or for that interface? Or post it's full configuration and tell for what You use connmann? It's for network roaming mainly I assume and more typically used for WiFi connections and such . But should be configurable sufficiently even if You do not want to lack it's services (otherwise the tool wouldn't be useful at all). It's just doing many things automatically (independent of the interfaces config used for Debian network).
    – user301446
    Commented Nov 12, 2019 at 21:45
  • Thanks again! I added some more lines of the output of journalctl -b that show that apparently all settings I made in /etc/network/interfaces seem to be handled by connman. The file /etc/connman/main.conf only contains the six lines that are already in my original post. Are there any other config files for connman that I'm not aware of?
    – tsc6666
    Commented Nov 13, 2019 at 7:30
  • As you suggested, I simply disabled connman to handle eth0 by changing the last line of /etc/connman/main.conf to NetworkInterfaceBlacklist=eth0,SoftAp0,usb0,usb1 This changed the output of route to Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 192.168.5.254 0.0.0.0 UG 0 0 0 eth0 192.168.5.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 Now everything seems to work fine. Thanks a lot, you saved my day! Would you like to post that as an answer to my question?
    – tsc6666
    Commented Nov 13, 2019 at 7:49
  • OK I add it. You can also find Your service for eth0 with connmanctl services, check it's properties with connmanctl services service_name and change configuration with connmanctl config service_name .. or check the config files in /var/lib/connman/.
    – user301446
    Commented Nov 13, 2019 at 12:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .