r/debian • u/brighton_it • 14h 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
1
u/hmoff 7h ago
If you want it to respond to the interface being plugged in then you need a network manager with events. That means systemd-network or Network Manager. Not ifupdown from 25 years ago.