"no valid interfaces found" for interface in network namespace
Justin Humm
Fri Sep 18 22:05:39 2020I have trouble configuring my interface with Dhcpcd when using Linux network namespaces (netns). My use case is to eventually configure a Wireguard VPN using a namespace `physical` for enp0s25 and another namespace `1` for applications communicating over the VPN. That's also the recommended way to set up by the Wireguard project [0]. # Reproducing the error I'm using dhcpcd from latest master (01e57be54c56f6fbe0566e3aff438588030581f9). # uname -a Linux maschine 5.4.65 #1-NixOS SMP Sat Sep 12 12:18:56 UTC 2020 x86_64 GNU/Linux Also no dhcpcd process is running. # dhcpcd --exit Test that dhcpcd without any namespaces runs fine for both setting the interface via config file as well as providing the interface as an argument. # cat dhcpcd.config allowinterfaces enp0s25 # dhcpcd --oneshot --debug --config dhcpcd.config ... runs fine # dhcpcd --oneshot --debug enp0s25 ... runs fine Then I add a namespace physical and put my ethernet interface in it. # ip netns add physical # ip link set enp0s25 netns physical Now I run dhcpcd inside the physical network namespace. Weird thing is that configuring the interface by providing it via the command line works fine, while… # ip netns exec physical dhcpcd --oneshot --debug enp0s25 ... runs fine …using the config file fails with "no valid interfaces found". # ip netns exec physical dhcpcd --oneshot --debug --config dhcpcd.config no such user dhcpcd dhcpcd-9.2.0 starting udev: starting dev: loaded udev DUID Redacted no valid interfaces found exiting due to oneshot no interfaces have a carrier exiting due to oneshot dev: unloaded udev dhcpcd exited # Expected behaviour I'd expect it to configure fine with an interface provided via allowinterfaces in the config file. Also it would be nice to receive some more logging for what interfaces where detected and why they were found to be not valid. Any idea what is the problem here? Thanks, Justin [0] https://www.wireguard.com/netns/#the-new-namespace-solution
Attachment:
signature.asc
Description: signature
| Re: "no valid interfaces found" for interface in network namespace | Roy Marples |