0

I have to add the multicast route, that is needed when no default gateway is configured. Mono needs this in order to join multicast groups. The configuring is done in /etc/network/interfaces.d/eth0

Now the peculiar thing is:

If eth0 is configured with a static IP it works:

allow-hotplug eth0
iface eth0 inet static
address 192.168.0.200
netmask 255.255.255.0
up ip route add 224.0.0.0/4 dev eth0

If eth0 is configured to dhcp, ip route is not called:

allow-hotplug eth0
iface eth0 inet dhcp
up ip route add 224.0.0.0/4 dev eth0

I tried a shell script writing a timestamp into a file in the up line but that does not get called either. So it seems to be the script not being called rather than the ip route command failing or getting overridden.

The systems in question are debian stretch, buster. This is running on embedded units with a readonly root partition.

Am I missing something here, why does it work with static config but not with dhcp?

To avoid the XY problem, is there a different method maybe to add said route at startup?

  • 1
    reproducing a setup equivalent to yours in buster (just in a LXC container) shows the route added with a dhcp setting. It can be seen without script with `ifup -v eth0` which will show commands executed. Maybe your embedded environment is different enough to deviate from default behavior? – A.B Feb 10 '22 at 19:22
  • Thanks, `-v` helped to understand the issue. In fact there's a `dhcpcd` error, resulting in `ifup` terminating at the `dhcp` command and not executing any `up` command thereafter. – Holger Böhnke Feb 22 '22 at 11:25

0 Answers0