Sample Header Ad - 728x90

Prevent connman from adding a default route for networks without a gateway

5 votes
1 answer
2047 views
I have a PC running K3OS with two ethernet interfaces. One (eth0) is connected to a network without a DHCP server with a static IP address and the other (eth1) is connected to a network with a DHCP, which returns a default gateway. K3OS uses connman as its network manager. I configured two connman services, c and d:
/net/connman/service/ethernet_00606561750c_cable
  Type = ethernet
  Security = [  ]
  State = ready
  Favorite = True
  Immutable = False
  AutoConnect = True
  Name = Wired
  Ethernet = [ Method=auto, Interface=eth0, Address=xx:xx:xx:xx:xx:xx, MTU=1500 ]
  IPv4 = [ Method=dhcp, Address=10.4.144.15, Netmask=255.255.255.0, Gateway=10.4.144.254 ]
  IPv4.Configuration = [ Method=dhcp ]
  IPv6 = [  ]
  IPv6.Configuration = [ Method=auto, Privacy=disabled ]
  Nameservers = [ 10.1.1.60 ]
  Nameservers.Configuration = [  ]
  Timeservers = [ 10.1.1.60 ]
  Timeservers.Configuration = [  ]
  Domains = [ domain.com ]
  Domains.Configuration = [  ]
  Proxy = [  ]
  Proxy.Configuration = [  ]
  mDNS = False
  mDNS.Configuration = False
  Provider = [  ]
/net/connman/service/ethernet_00606561750d_cable
  Type = ethernet
  Security = [  ]
  State = ready
  Favorite = True
  Immutable = False
  AutoConnect = True
  Name = Wired
  Ethernet = [ Method=auto, Interface=eth1, Address=xx:xx:xx:xx:xx:xx, MTU=1500 ]
  IPv4 = [ Method=manual, Address=192.168.10.3, Netmask=255.255.255.0 ]
  IPv4.Configuration = [ Method=manual, Address=192.168.10.3, Netmask=255.255.255.0 ]
  IPv6 = [  ]
  IPv6.Configuration = [ Method=off ]
  Nameservers = [ 8.8.8.8 ]
  Nameservers.Configuration = [  ]
  Timeservers = [  ]
  Timeservers.Configuration = [  ]
  Domains = [  ]
  Domains.Configuration = [  ]
  Proxy = [  ]
  Proxy.Configuration = [  ]
  mDNS = False
  mDNS.Configuration = False
  Provider = [  ]
Now what happens, after I reboot the PC or restart the service, I get a default route over eth1 set by connman. But eth1 doesn't feature a Gateway address so all my requests to other networks will fail. My understanding is that connman has an internal ordering of services. The ordering happens by respecting the settings of PreferredTechnologies in /etc/connman/main.config. When two services of the same technologies are available, it will priotize the one, which was ready the first (Source: Documentation ). But what I don't understand is, why connman would add a default route for networks without a default gateway. Is there a way to tell connman that a certain service does not feature a default gateway? Thanks.
Asked by Ka0o0 (51 rep)
Oct 29, 2020, 01:36 PM
Last activity: Jun 27, 2024, 08:00 AM