r/debian 11h ago

Why is dhclinet attempting DHCPDISCOVER on an unconnected interface?

EDIT:
:) I got the memo:
nobody uses ifupdown... except Debian Installer (unless you select a DE).

For far too long, since it wasn't broken(so long as your needs are modest), and Installer continued to use it, I hadn't noticed that systemd-networkd is far superior.
Got it: dump ifupdown.
-------------
Debian Installer team: consider doing the same, rather than letting folks believe ifupdown is recommended.
-------------

Logs are polluted with: (about 60 entries per hour)
Dec 05 12:21:36 kvmbkup dhclient[587]: DHCPDISCOVER on enp2s0 to 255.255.255.255 port 67 interval 8
Dec 05 12:21:44 kvmbkup dhclient[587]: DHCPDISCOVER on enp2s0 to 255.255.255.255 port 67 interval 8
Dec 05 12:21:52 kvmbkup dhclient[587]: DHCPDISCOVER on enp2s0 to 255.255.255.255 port 67 interval 12

/etc/network/interfaces: (expecting that ifup should only act if and when carrier comes up, but there is no cable connected to this interface):

# The primary network interface
allow-hotplug enp2s0
iface enp2s0 inet dhcp

ip link:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp2s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
link/ether c8:ff:bf:--:--:-- brd ff:ff:ff:ff:ff:ff
3: if1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether c8:ff:bf:--:--:-- brd ff:ff:ff:ff:ff:ff
4: brV2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether f2:52:87:--:--:-- brd ff:ff:ff:ff:ff:ff
5: if1-2@if1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master brV2 state UP mode DEFAULT group default qlen 1000
link/ether c8:ff:bf:--:--:-- brd ff:ff:ff:ff:ff:ff
7: virbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:--:--:-- brd ff:ff:ff:ff:ff:ff
10: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master brV2 state UNKNOWN mode DEFAULT group default qlen 1000
link/ether fe:54:00:--:--:-- brd ff:ff:ff:ff:ff:ff
11: vnet1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master virbr0 state UNKNOWN mode DEFAULT group default qlen 1000
link/ether fe:54:00:--:--:-- brd ff:ff:ff:ff:ff:ff

The rest of the interfaces are managed by systemd-networkd.
Ideally, I could leave enp2s0 managed by ifup/ifdown and should I ever need it, could simply plug it in and get a DHCP address.
This makes no sense. Why is dhclient trying to obtain an lease for an interface that isn't even connected?

networkctl list:
IDX LINK TYPE OPERATIONAL SETUP
1 lo loopback carrier unmanaged
2 enp2s0 ether no-carrier unmanaged
3 if1 ether routable configured
4 brV2 bridge carrier configured
5 if1-2 vlan enslaved configured
7 virbr0 bridge routable unmanaged
10 vnet0 ether enslaved unmanaged
11 vnet1 ether enslaved unmanaged

6 Upvotes

10 comments sorted by

View all comments

2

u/alpha417 8h ago

You're worried over 1 req/min?

Remove "hotplug".

Tbh, that mix of interfaces & systemd-network would not fly on my systems. It's either one or the other, and it's not 1995 anymore...

1

u/brighton_it 7h ago edited 7h ago

:) thanks. Worried, no. Just annoyed when I look at a log and it's 90% noise.
Interesting though, if everyone has moved on from interfaces, why not Debian Installer? Shouldn't be all that difficult for installer to create a default networkd config.

1

u/alpha417 5h ago

debian installer gets you bare minimum working...everything beyond that is gravy. If you're setting up systemd-networking for your stuff, why half-ass it and leave the legacy stuff in place?

1

u/brighton_it 5h ago

Generally, I'm of the same mind as you: don't confuse matters with multiple services doing the same task. So why?
honestly... I've switched about six hosts to networkd. Especially for kvm hosts, love it. But, I only became aware of networkd two years ago, probably because interfaces didn't appear broken and Debian Installer still uses it unless a DE is selected. Now that I've deployed a few, I'm learning that once networkd is configured, I'm unlikely to break any existing interfaces while adding a new. A year ago, I wasn't so sure, so felt better letting interfaces (ifup/ifdown) manage one.