You are not logged in.

#1 2014-02-16 23:10:46

synthead
Member
Registered: 2006-05-09
Posts: 1,337

Problems setting up network interfaces using systemd

I am building a firewall.  I have two interfaces I set up via udev rules: eth-wan and eth-lan.  I want eth-wan to negotiate DHCP whenever the link is active, and I want eth-lan to be on a static IP.  I always want these interfaces to be up regardless of link status.

Following the wiki, I did this for eth-wan: https://wiki.archlinux.org/index.php/Ne … CP_at_boot
However, if I run "systemctl start dhcpcd@eth-wan", it hangs and eventually fails.  "journalctl -xn" reports "Timed out waiting for device sys-subsystem-net-devices-eth-wan.device." and "Dependency failed for dhcpcd on eth/wan."  It's interesting how it sees it as eth/wan instead of eth-wan.  If I run dhcpcd manually via "dhcpcd eth-wan", it starts the daemon without any issues and gets an IP.

For eth-lan, I also followed the wiki: https://wiki.archlinux.org/index.php/Ne … ng_systemd
I am using the network@.service file provided in the above link exactly.  If I run "systemctl start network@eth-lan", it also hangs and fails with "Dependency failed for Network connectivity (eth-lan)"."  If I run the "ip" commands in it manually, it comes up just fine also.

Both of these interfaces are down when the system boots after failing with these errors at boot.  What now?

Offline

#2 2014-02-16 23:16:59

synthead
Member
Registered: 2006-05-09
Posts: 1,337

Re: Problems setting up network interfaces using systemd

Well that's interesting, I renamed the interfaces "wan" and "lan", excluding the susceptible hyphen due to systemctl seeing that one interface as "eth/wan" instead of "eth-wan" and they both came up with no issues.  I suppose I can handle this from here, but why would systemd behave this way with the hyphens?

Offline

#3 2014-02-17 17:02:23

Andreaskem
Member
Registered: 2013-10-13
Posts: 67

Re: Problems setting up network interfaces using systemd

$ man systemd.unit

[...]
Some unit names reflect paths existing in the file system namespace. Example: a device unit dev-sda.device refers to a device with the device node /dev/sda in the file system namespace. If this applies, a special way to escape the path name is used, so that the result is usable as part of a filename. Basically, given a path, "/" is replaced by "-", and all unprintable characters and the "-" are replaced by C-style "\x20" escapes. The root directory "/" is encoded as single dash, while otherwise the initial and ending "/" is removed from all paths during transformation. This escaping is reversible.
[...]

Last edited by Andreaskem (2014-02-17 17:02:56)

Offline

Board footer

Powered by FluxBB