Your message dated Sun, 10 Mar 2024 20:59:39 +0000
with message-id <[email protected]>
and subject line Bug#1031236: fixed in ifupdown 0.8.42
has caused the Debian Bug report #1031236,
regarding ifupdown: dns-nameservers with systemd-resolved is broken
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
1031236: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1031236
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: ifupdown
Version: 0.8.41
Severity: normal
Dear Maintainer,
I was doing my network setup, which included statically configured
logical interfaces. So there were dns-nameservers entries in my
/etc/network/interfaces. My configuration files is below (the actual
IPs and MACs is wiped).
I noted that ifup with my setup is producing error messages like this:
...
guessnet: Started tests
guessnet: 3 candidates
guessnet: Got ARP reply from 192.168.0.1 XX:XX:XX:XX:XX:XX
guessnet: ARP reply from 192.168.0.1 XX:XX:XX:XX:XX:XX matches
guessnet: Notified success of scan peer 192.168.0.1 XX:XX:XX:XX:XX:XX
guessnet: Removing candidate enp4s0-direct
guessnet: Keeping candidate enp4s0-router
guessnet: We had changes, notifying the listener
guessnet: Got ARP reply from 192.168.0.1 XX:XX:XX:XX:XX:XX
/etc/network/if-up.d/resolved: 69: DNS: not found
/etc/network/if-up.d/resolved: 1: /run/network/ifupdown-inet-enp4s0:
DNS=192.168.0.1 192.168.0.12: not found
Failed to parse DNS server address: DNS
Failed to set DNS configuration: Invalid argument
I have found discussion about similar problem there:
https://unix.stackexchange.com/questions/714901/dns-broken-when-using-ifupdown-and-systemd-resolved-after-upgrade-to-ubuntu-22-0
Also I had a look into the /etc/network/if-up.d/resolved and I assume
this is a typo in the line 69:
https://salsa.debian.org/debian/ifupdown/-/blob/master/debian/if-up.d/resolved#L69
Then I edited mine /etc/network/if-up.d/resolved this way:
--- a/network/if-up.d/resolved
+++ b/network/if-up.d/resolved
@@ -43,11 +43,11 @@ if systemctl is-enabled systemd-resolved > /dev/null 2>&1;
then
fi
if [ -n "$NEW_DNS" ]; then
cat <<EOF >"$mystatedir/ifupdown-${ADDRFAM}-$interface"
-"$DNS"="$NEW_DNS"
+$DNS="$NEW_DNS"
EOF
if [ -n "$NEW_DOMAINS" ]; then
cat <<EOF >>"$mystatedir/ifupdown-${ADDRFAM}-$interface"
-"$DOMAINS"="$NEW_DOMAINS"
+$DOMAINS="$NEW_DOMAINS"
EOF
fi
fi
@@ -66,7 +66,7 @@ EOF
# ignore errors due to nonexistent file
md5sum "$mystatedir/isc-dhcp-v4-$interface"
"$mystatedir/isc-dhcp-v6-$interface" "$mystatedir/ifupdown-inet-$interface"
"$mystatedir/ifupdown-inet6-$interface" > "$newstate" 2> /dev/null || true
if ! cmp --silent "$oldstate" "$newstate" 2>/dev/null; then
- DNS DNS6 DOMAINS DOMAINS6 DEFAULT_ROUTE
+ # DNS DNS6 DOMAINS DOMAINS6 DEFAULT_ROUTE
# v4 first
if [ -e "$mystatedir/isc-dhcp-v4-$interface" ]; then
. "$mystatedir/isc-dhcp-v4-$interface"
And now it works well.
I'm guessing that someone might also have a static network
configuration at the same time as systemd-resolved installed, so I hope
this information can help someone.
Kind regards,
Dmytro
-- Package-specific info:
--- /etc/network/interfaces:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
# allow-hotplug enp4s0
# iface enp4s0 inet dhcp
# This is an autoconfigured IPv6 interface
# iface enp4s0 inet6 auto
allow-hotplug wlp0s20f3
iface wlp0s20f3 inet manual
wpa-driver wext
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
allow-hotplug enp4s0
mapping enp4s0
script /usr/sbin/guessnet-ifupdown
map autofilter: true
map verbose: true
map debug: true
map default: enp4s0-guest
# sorry, I do not wish to publish the actual addresses there
iface enp4s0-router inet static
address 192.168.0.44
netmask 255.255.255.0
gateway 192.168.0.1
test peer address 192.168.0.1 mac XX:XX:XX:XX:XX:XX source
dns-nameservers 192.168.0.1
dns-nameservers 192.168.0.12
iface enp4s0-direct inet static
address XX.XX.XXX.XX
netmask 255.255.255.0
gateway XX.XX.XXX.X
test peer address XX.XX.XXX.X mac XX:XX:XX:XX:XX:XX source
dns-nameservers XX.XX.XXX.XXX
dns-nameservers XX.XXX.XXX.XXX
iface enp4s0-guest inet dhcp
--- /etc/network/interfaces.d/*:
cat: '/etc/network/interfaces.d/*': No such file or directory
--- up and down scripts installed:
/etc/network/if-down.d:
total 8
-rwxr-xr-x 1 root root 372 Apr 21 2020 openvpn
-rwxr-xr-x 1 root root 759 Sep 27 16:09 resolved
lrwxrwxrwx 1 root root 32 Jan 31 13:58 wpasupplicant ->
../../wpa_supplicant/ifupdown.sh
/etc/network/if-post-down.d:
total 4
-rwxr-xr-x 1 root root 1409 Jun 5 2018 wireless-tools
lrwxrwxrwx 1 root root 32 Jan 31 13:58 wpasupplicant ->
../../wpa_supplicant/ifupdown.sh
/etc/network/if-pre-up.d:
total 8
-rwxr-xr-x 1 root root 4191 Sep 15 2018 wireless-tools
lrwxrwxrwx 1 root root 32 Jan 31 13:58 wpasupplicant ->
../../wpa_supplicant/ifupdown.sh
/etc/network/if-up.d:
total 12
-rwxr-xr-x 1 root root 385 Apr 21 2020 openvpn
-rwxr-xr-x 1 root root 4661 Feb 13 19:47 resolved
lrwxrwxrwx 1 root root 32 Jan 31 13:58 wpasupplicant ->
../../wpa_supplicant/ifupdown.sh
-- System Information:
Debian Release: bookworm/sid
APT prefers testing
APT policy: (800, 'testing'), (700, 'stable'), (600, 'unstable'), (500,
'stable-security'), (50, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 6.1.0-3-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=uk_UA.UTF-8, LC_CTYPE=uk_UA.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages ifupdown depends on:
ii adduser 3.131
ii iproute2 6.1.0-1
ii libc6 2.36-8
Versions of packages ifupdown recommends:
ii isc-dhcp-client [dhcp-client] 4.4.3-P1-1.1
Versions of packages ifupdown suggests:
ii ppp 2.4.9-1+1.1+b1
pn rdnssd <none>
-- Configuration Files:
/etc/network/if-up.d/resolved changed:
case "$ADDRFAM" in
inet|inet6) : ;;
*) exit 0 ;;
esac
if systemctl is-enabled systemd-resolved > /dev/null 2>&1; then
interface=$IFACE
if [ ! "$interface" ]; then
return
fi
# TODO handle lo interface settings
if [ "$interface" = "lo" ]; then
return
fi
ifindex=$(cat "/sys/class/net/$interface/ifindex")
if [ ! "$ifindex" ]; then
return
fi
mystatedir=/run/network
mkdir -p $mystatedir
statedir=/run/systemd/resolve/netif
mkdir -p $statedir
chown systemd-resolve:systemd-resolve $statedir
oldstate="$(mktemp)"
# ignore errors due to nonexistent file
md5sum "$mystatedir/isc-dhcp-v4-$interface"
"$mystatedir/isc-dhcp-v6-$interface" "$mystatedir/ifupdown-inet-$interface"
"$mystatedir/ifupdown-inet6-$interface" > "$oldstate" 2> /dev/null || true
NEW_DEFAULT_ROUTE=$IF_DNS_DEFAULT_ROUTE
NEW_DNS=$(echo $IF_DNS_NAMESERVERS $IF_DNS_NAMESERVER)
NEW_DOMAINS=$(echo $IF_DNS_DOMAIN $IF_DNS_SEARCH)
DNS=DNS
DOMAINS=DOMAINS
if [ "$ADDRFAM" = "inet6" ]; then
DNS=DNS6
DOMAINS=DOMAINS6
fi
if [ -n "$NEW_DNS" ]; then
cat <<EOF >"$mystatedir/ifupdown-${ADDRFAM}-$interface"
$DNS="$NEW_DNS"
EOF
if [ -n "$NEW_DOMAINS" ]; then
cat <<EOF >>"$mystatedir/ifupdown-${ADDRFAM}-$interface"
$DOMAINS="$NEW_DOMAINS"
EOF
fi
fi
case "$NEW_DEFAULT_ROUTE" in
1|yes|true|on) NEW_DEFAULT_ROUTE=yes ;;
0|no|false|off) NEW_DEFAULT_ROUTE=no ;;
*) NEW_DEFAULT_ROUTE= ;;
esac
if [ -n "$NEW_DEFAULT_ROUTE" ]; then
cat <<EOF >>"$mystatedir/ifupdown-${ADDRFAM}-$interface"
DEFAULT_ROUTE="$NEW_DEFAULT_ROUTE"
EOF
fi
newstate="$(mktemp)"
# ignore errors due to nonexistent file
md5sum "$mystatedir/isc-dhcp-v4-$interface"
"$mystatedir/isc-dhcp-v6-$interface" "$mystatedir/ifupdown-inet-$interface"
"$mystatedir/ifupdown-inet6-$interface" > "$newstate" 2> /dev/null || true
if ! cmp --silent "$oldstate" "$newstate" 2>/dev/null; then
# DNS DNS6 DOMAINS DOMAINS6 DEFAULT_ROUTE
# v4 first
if [ -e "$mystatedir/isc-dhcp-v4-$interface" ]; then
. "$mystatedir/isc-dhcp-v4-$interface"
fi
# v4 manual config overrides
if [ -e "$mystatedir/ifupdown-inet-$interface" ]; then
. "$mystatedir/ifupdown-inet-$interface"
fi
# v6 preffered
if [ -e "$mystatedir/isc-dhcp-v6-$interface" ]; then
. "$mystatedir/isc-dhcp-v6-$interface"
fi
# v6 manual config overrides
if [ -e "$mystatedir/ifupdown-inet6-$interface" ]; then
. "$mystatedir/ifupdown-inet6-$interface"
fi
resolvectl_failed=
if [ "$DNS" ] || [ "$DNS6" ] ; then
cat <<EOF >"$statedir/$ifindex"
LLMNR=yes
MDNS=no
SERVERS=$(echo $DNS6 $DNS)
DOMAINS=$(echo $DOMAINS6 $DOMAINS)
EOF
if [ -n "$DEFAULT_ROUTE" ]; then
cat <<EOF >>"$statedir/$ifindex"
DEFAULT_ROUTE=$DEFAULT_ROUTE
EOF
fi
chown systemd-resolve:systemd-resolve "$statedir/$ifindex"
# In addition to creating the state file (needed if we run before
# resolved is started), also feed the information directly to
# resolved.
if systemctl --quiet is-active systemd-resolved; then
resolvectl llmnr "$ifindex" yes || resolvectl_failed=$?
resolvectl mdns "$ifindex" no || resolvectl_failed=$?
if [ "$DOMAINS6" ] || [ "$DOMAINS" ]; then
resolvectl domain "$ifindex" $DOMAINS6 $DOMAINS ||
resolvectl_failed=$?
else
resolvectl domain "$ifindex" "" || resolvectl_failed=$?
fi
resolvectl dns "$ifindex" $DNS6 $DNS || resolvectl_failed=$?
if [ "$DEFAULT_ROUTE" ]; then
resolvectl default-route "$ifindex" $DEFAULT_ROUTE ||
resolvectl_failed=$?
fi
fi
else
rm -f "$statedir/$ifindex"
if systemctl --quiet is-active systemd-resolved; then
resolvectl revert "$ifindex" || resolvectl_failed=$?
fi
fi
# resolved was running, but without dbus, it means state files
# will not be read & resolvectl commands failed, restart it
if [ "$resolvectl_failed" ]; then
systemctl try-restart systemd-resolved
fi
fi
rm -f "$oldstate" "$newstate"
fi
-- no debconf information
--- End Message ---
--- Begin Message ---
Source: ifupdown
Source-Version: 0.8.42
Done: Santiago Ruano Rincón <[email protected]>
We believe that the bug you reported is fixed in the latest version of
ifupdown, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Santiago Ruano Rincón <[email protected]> (supplier of updated ifupdown
package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Format: 1.8
Date: Sun, 10 Mar 2024 17:17:50 -0300
Source: ifupdown
Architecture: source
Version: 0.8.42
Distribution: unstable
Urgency: medium
Maintainer: Josué Ortega <[email protected]>
Changed-By: Santiago Ruano Rincón <[email protected]>
Closes: 1031236 1059919
Changes:
ifupdown (0.8.42) unstable; urgency=medium
.
[ Uwe Kleine-König ]
* Fix if-up.d/resolved hook to properly work with nameservers and search
domains. Thanks to Dmytro Kolesnykov and Ken Milmore for the bug report
and a proposed patch. (Closes: #1031236)
.
[ Guillem Jover ]
* Use relative names when executing programs
.
[ Santiago Ruano Rincón ]
* DEP17: Move files to /usr. Thanks to Helmut Grohne <[email protected]>
(Closes: #1059919)
Checksums-Sha1:
e1df2db1fd61fe9ff580ffce9a27f7ddf1cdfa79 986 ifupdown_0.8.42.dsc
1f431b70b6bfa1dce78d0a519c5706a0c51508b7 82428 ifupdown_0.8.42.tar.xz
8761e899536040e9c70e83c4a046fe044d9a0bd3 5584 ifupdown_0.8.42_amd64.buildinfo
Checksums-Sha256:
0d5c2edb2275b9ad5d08bbea5cfbfeee7cfe76a953aff39c43ba19829c3a964c 986
ifupdown_0.8.42.dsc
7e2dc1498415c2518a3826e3b875ced871d0622a421a71390627cc35bd247964 82428
ifupdown_0.8.42.tar.xz
d84060a45b16a8c7a976ae2f7c34dd2f7f4655ad86c1751fdeeb543fdb0d0cda 5584
ifupdown_0.8.42_amd64.buildinfo
Files:
0ed8c040b07b75a570034e884a4d539f 986 admin important ifupdown_0.8.42.dsc
a5681694a2229f2a3fe12ae035c97174 82428 admin important ifupdown_0.8.42.tar.xz
667c9e5a5e9f5a4e6c5a5cf0fea078fb 5584 admin important
ifupdown_0.8.42_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----
iHUEARYIAB0WIQRZVjztY8b+Ty43oH1itBCJKh26HQUCZe4WOwAKCRBitBCJKh26
HYa1AQD9Pv/AleDf4++yFX20xdIcAcCQzNg5NOfVlCeUgIBLpgEA6jlKlAn/Uj10
4M0r/tx/WsYKjAdToLWib1pBESBTZAo=
=I0mo
-----END PGP SIGNATURE-----
pgpsH2aER6syR.pgp
Description: PGP signature
--- End Message ---