0

I'm using Debian Buster and I have two interfaces configured: eth0 and wwan0 (broadband modem). Here's the relevant part of my interfaces file:

# The primary network interface
auto eth0
iface eth0 inet dhcp

# Do not bring up wwan0 automatically
allow-hotplug wwan0
iface wwan0 inet dhcp
        pre-up until [ -h /dev/ublox00 ]; do sleep 1; done && echo $'AT+UCEDATA=1,0\r\n' > /dev/ublox00 && sleep 2
        post-down echo $'AT+CGACT=0\r\n' > /dev/ublox00

I've noticed that when I want to bring wwan0 down, it also releases the IP address for eth0:

$ sudo ifdown -v wwan0
ifdown: configuring interface wwan0=wwan0 (inet)
/bin/run-parts --verbose /etc/network/if-down.d
run-parts: executing /etc/network/if-down.d/wpasupplicant
/sbin/dhclient -4 -v -i -r -pf /run/dhclient.wwan0.pid -lf /var/lib/dhcp/dhclient.wwan0.leases -I -df /var/lib/dhcp/dhclient6.wwan0.leases wwan0
Killed old client process
Internet Systems Consortium DHCP Client 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/98:f0:7b:98:7a:89
Sending on   LPF/eth0/98:f0:7b:98:7a:89
Listening on LPF/wwan0/ee:bc:6c:be:6d:7c
Sending on   LPF/wwan0/ee:bc:6c:be:6d:7c
Sending on   Socket/fallback
DHCPRELEASE of 192.168.1.101 on eth0 to 192.168.1.1 port 67
DHCPRELEASE of 100.68.214.247 on wwan0 to 100.68.214.248 port 67
/sbin/ip link set dev wwan0 down
/bin/run-parts --verbose /etc/network/if-post-down.d
run-parts: executing /etc/network/if-post-down.d/hostapd
run-parts: executing /etc/network/if-post-down.d/wireless-tools
run-parts: executing /etc/network/if-post-down.d/wpasupplicant
echo $'AT+CGACT=0\r\n' > /dev/ublox00

And requests it again after bringing the interface up:

$ sudo ifup -v wwan0
ifup: configuring interface wwan0=wwan0 (inet)
until [ -h /dev/ublox00 ]; do sleep 1; done && echo $'AT+UCEDATA=1,0\r\n' > /dev/ublox00 && sleep 2
/bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
run-parts: executing /etc/network/if-pre-up.d/hostapd
run-parts: executing /etc/network/if-pre-up.d/wireless-tools
run-parts: executing /etc/network/if-pre-up.d/wpasupplicant

/sbin/dhclient -4 -v -i -pf /run/dhclient.wwan0.pid -lf /var/lib/dhcp/dhclient.wwan0.leases -I -df /var/lib/dhcp/dhclient6.wwan0.leases wwan0
Internet Systems Consortium DHCP Client 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/98:f0:7b:98:7a:89
Sending on   LPF/eth0/98:f0:7b:98:7a:89
Listening on LPF/wwan0/ee:bc:6c:be:6d:7c
Sending on   LPF/wwan0/ee:bc:6c:be:6d:7c
Sending on   Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3
DHCPDISCOVER on wwan0 to 255.255.255.255 port 67 interval 6
DHCPOFFER of 192.168.1.101 from 192.168.1.1
DHCPREQUEST for 192.168.1.101 on eth0 to 255.255.255.255 port 67
DHCPOFFER of 100.68.214.247 from 100.68.214.248
DHCPREQUEST for 100.68.214.247 on wwan0 to 255.255.255.255 port 67
DHCPACK of 100.68.214.247 from 100.68.214.248
bound to 100.68.214.247 -- renewal in 74796 seconds.
/bin/run-parts --exit-on-error --verbose /etc/network/if-up.d
run-parts: executing /etc/network/if-up.d/wpasupplicant

The commands sudo ifdown eth0 and sudo ifup eth0 operate on eth0 only as expected. Please help me find the problem.

My ifupdown version is 0.8.35.

1 Answer 1

0

I think I found the cause for this.

Search for interface "name" { declarations ... } at https://linux.die.net/man/5/dhclient.conf:

A client with more than one network interface may require different behaviour depending on which interface is being configured. All timing parameters and declarations other than lease and alias declarations can be enclosed in an interface declaration, and those parameters will then be used only for the interface that matches the specified name. Interfaces for which there is no interface declaration will use the parameters declared outside of any interface declaration, or the default settings.

Note well: ISC dhclient only maintains one list of interfaces, which is either determined at startup from command line arguments, or otherwise is autodetected. If you supplied the list of interfaces on the command line, this configuration clause will add the named interface to the list in such a way that will cause it to be configured by DHCP. Which may not be the result you had intended. This is an undesirable side effect that will be addressed in a future release.

I had this section in my dhclient.conf file because I wanted to add a specific DNS server for eth0. If I remove this section, the problem disappears.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .