[systemd-devel] systemd-networkd bring interface up without link

Matt Zagrabelny mzagrabe at d.umn.edu
Tue May 7 01:22:29 UTC 2019


Greetings,

I'm using Debian Buster with systemd 241-3.

I have a computer (server) that is running isc-dhcpd and I have a hardwired
interface with static addressing on the computer:

$ cat /etc/systemd/network/eth-router.network
[Match]
MACAddress=00:01:c0:1e:25:dd

[Network]
Address=172.20.20.1/24

$ ip a
[...]
2: enp4s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN
group default qlen 1000
    link/ether 00:01:c0:1e:25:dd brd ff:ff:ff:ff:ff:ff
[...]

When I connect another computer (laptop) to the server via an ethernet
cable, the interface is brought up:

$ ip a
[...]
2: enp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP
group default qlen 1000
    link/ether 00:01:c0:1e:25:dd brd ff:ff:ff:ff:ff:ff
    inet 172.20.20.1/24 brd 172.20.20.255 scope global enp4s0
       valid_lft forever preferred_lft forever
    inet6 fe80::201:c0ff:fe1e:25dd/64 scope link
       valid_lft forever preferred_lft forever

However isc-dhcpd is unhappy about trying to answer lease requests from an
interface that doesn't have addressing - as isc-dhcpd has already started
from boot and the interface is brought up when a client plugs into the
ethernet cable:

Apr 25 18:14:48 zion dhcpd[651]: No subnet declaration for enp4s0 (no IPv4
addresses).
Apr 25 18:14:48 zion dhcpd[651]: ** Ignoring requests on enp4s0.  If this
is not what
Apr 25 18:14:48 zion dhcpd[651]:    you want, please write a subnet
declaration
Apr 25 18:14:48 zion dhcpd[651]:    in your dhcpd.conf file for the network
segment
Apr 25 18:14:48 zion dhcpd[651]:    to which interface enp4s0 is attached.
**
Apr 25 18:14:48 zion dhcpd[651]:

If I restart isc-dhcpd after the enp4s0 has an address, then my client
computer (laptop) is able to request and get an address:

May 06 19:46:12 zion dhcpd[3654]: Server starting service.
May 06 19:46:14 zion isc-dhcp-server[3641]: Starting ISC DHCPv4 server:
dhcpd.
May 06 19:46:14 zion systemd[1]: Started LSB: DHCP server.
May 06 19:46:16 zion dhcpd[3654]: DHCPDISCOVER from c4:65:16:04:24:92 via
enp4s0
May 06 19:46:17 zion dhcpd[3654]: DHCPOFFER on 172.20.20.181 to
c4:65:16:04:24:92 (tombstone) via enp4s0
May 06 19:46:17 zion dhcpd[3654]: DHCPREQUEST for 172.20.20.181
(172.20.20.1) from c4:65:16:04:24:92 (tombstone) via enp4s0
May 06 19:46:17 zion dhcpd[3654]: DHCPACK on 172.20.20.181 to
c4:65:16:04:24:92 (tombstone) via enp4s0

What is the proper way to handle this issue?

I also use the same isc-dhcpd to serve addresses out of a wifi interface,
so I don't think I could have the service start up after a *.network file
is activated - if that is the right terminology.

Is there a way to have systemd-network assign addressing to an interface
without the link being up?

Thanks for any help!

-m
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20190506/b829f564/attachment.html>


More information about the systemd-devel mailing list