Sample Header Ad - 728x90

How to prevent an unwanted default gateway to be added during reboot

1 vote
1 answer
4639 views
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: eth0 {add} address 192.168.5.1/24 label eth0 family 2 Nov 06 11:29:40 webserver avahi-daemon: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.5.1. Nov 06 11:29:40 webserver connmand: eth0 {add} route 192.168.5.0 gw 0.0.0.0 scope 253 Nov 06 11:29:40 webserver avahi-daemon: New relevant interface eth0.IPv4 for mDNS. Nov 06 11:29:40 webserver avahi-daemon: Registering new address record for 192.168.5.1 on eth0.IPv4. Nov 06 11:29:40 webserver connmand: eth0 {add} route 0.0.0.0 gw 192.168.5.254 scope 0 … 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?
Asked by tsc6666 (23 rep)
Nov 11, 2019, 07:47 AM
Last activity: Sep 13, 2023, 09:53 AM