dnsmasq-base causes network device virbr0 to shut down

Bug #2055455 reported by Box Noise
264
This bug affects 3 people
Affects Status Importance Assigned to Milestone
dnsmasq (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Installing dnsmasq-base v2.90-0ubuntu0.22.04.1 causes network device virbr0 to shut down during the boot-up process. Device virbr0 is installed by the libvirtd daemon. libvirtd gets an unexpected error when dnsmasq is called and then the address record for virbr0 is withdrawn.

This problem goes away when reverting back to dnsmasq-base v2.86-1.1

The attached text file provides relevant status reports which illustrate this problem. (status is shown for the system when using dnsmasq-base v2.90-0ubuntu0.22.04.1 when the problem occurs and then when the system operates correctly using dnsmasq-base v2.86-1.1)

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: dnsmasq-base 2.90-0ubuntu0.22.04.1
ProcVersionSignature: Ubuntu 5.15.0-60.66-generic 5.15.78
Uname: Linux 5.15.0-60-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: ubuntu:GNOME
Date: Thu Feb 29 10:29:20 2024
InstallationDate: Installed on 2018-10-08 (1970 days ago)
InstallationMedia: Ubuntu 18.04.1 LTS "Bionic Beaver" - Release amd64 (20180725)
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: dnsmasq
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Box Noise (box-noise) wrote :
Revision history for this message
Marc Deslauriers (mdeslaur) wrote (last edit ):

Hi,

What's the contents of the /etc/dnsmasq.d directory?
Is there a symlink to /etc/dnsmasq.d-available/libvirt-daemon ?

Revision history for this message
Mitchell Dzurick (mitchdz) wrote :

Thanks for taking the time to make this bug report to make Ubuntu better!

I tried reproducing your failure and unfortunately am not able to in a VM/container setup. I think this may need some extra configuration to reproduce the failure.

Starting with something basic, would you mind sharing these 2 files? Please remove/censor any information you do not want to share such as MAC address.

/etc/libvirt/qemu/networks/default.xml
/etc/dnsmasq.d-available/libvirt-daemon

And any other configuration files that you think may be useful.

Revision history for this message
Mitchell Dzurick (mitchdz) wrote :

I must've opened this bug up in the morning before Marc commented and just got back around to posting the question. Apologies for asking for the same information!

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

This may be caused by the same issue as bug 2055776. I am preparing updated packages with the problematic commit reverted for testing.

Revision history for this message
Box Noise (box-noise) wrote (last edit ):

(Note: New bug #2055776 opened a couple hours ago that looks related to this issue)

For the following answers to your queries, I used both the new and previous versions of dnsmasq-base with identical results:

What's the contents of the /etc/dnsmasq.d directory?
There is a symbolic link in this dir: libvirt-daemon -> /etc/dnsmasq.d-available/libvirt-daemon

sudo cat /etc/dnsmasq.d-available/libvirt-daemon

bind-interfaces
except-interface=virbr0

sudo cat /etc/libvirt/qemu/networks/default.xml

<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
  virsh net-edit default
or other application using the libvirt API.
-->
<network>
  <name>default</name>
  <uuid>2503f137-xxxx-xxxx-a9a0-3f709e7da000</uuid>
  <forward mode='nat'/>
  <bridge name='virbr0' stp='on' delay='0'/>
  <mac address='52:54:xx:xx:c7:d9'/>
  <ip address='192.168.122.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.122.2' end='192.168.122.254'/>
    </dhcp>
  </ip>
</network>

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

What's the output of "sudo netstat --tcp --udp --listening --programs --numeric"? Thanks!

information type: Public → Public Security
Revision history for this message
Box Noise (box-noise) wrote :

Attached txt file for output of netstat command ... first with dnsmasq-base v 2.90-0ubuntu0.22.04.1 and then with previous version 2.86-1.1

If I look at the output from the ifconfig command, the virbr0 device is listed when v2.86-1.1 is used. The virbr0 device is not listed when rebooting with the newer version (2.90-0ubuntu0.22.04.1) of dnsmasq-base

Revision history for this message
Marc Deslauriers (mdeslaur) wrote (last edit ):

So, it looks like you are running bind on this machine, and bind is listening on port 53 UDP:

udp 0 0 192.168.122.1:53 0.0.0.0:* 1521/named

The old dnsmasq would ignore the error when it couldn't bind to a port, but the new dnsmasq will fail if the port is already used, which makes sense.

Perhaps you need to configure bind to not listen on the 192.168.122.1 interface...

Revision history for this message
Box Noise (box-noise) wrote :

Your suggestion to limit bind will work for me.

I wasn't sure how to tell bind to not listen on an interface.
Bind defaults to: listen-on { any; };

I modified /etc/bind/named.conf.options by adding the following line:
listen-on port 53 { 127.0.0.1; 192.168.2/24; };

This should restrict bind to localhost and my main network, and should prevent it from attaching to the virbr0 interface.

After installing the current version of dnsmasq (2.90-0ubuntu0.22.04.1) and rebooting, it looks like everything is working properly now.

Thanks for all the help with this issue!

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

That is great news, I'm glad we've identified the root cause of the problem and you have successfully resolved it.

I will mark this bug as invalid since, while the dnsmasq update did change behaviour, the behaviour change revealed a configuration issue rather than being an actual regression.

Thanks!

Changed in dnsmasq (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public Security information  
Everyone can see this security related information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.