Welcome Guest. Please Login or Register  


You are here: Index > Virtualizor - Virtual Server Control Panel > General Support > Topic : dnsmasq: failed to create listening socket for 192.168.2.1: Address already in use - Ubuntu 22.04



Threaded Mode | Print  

 dnsmasq: failed to create listening socket for 192.168.2.1: Address already in use - Ubuntu 22.04 (6 Replies, Read 3307 times)
CosmosCraft
Group: Member
Post Group: Newbie
Posts: 5
Status:
Hello there!

I'm currently migrating things over to a new machine.
The new machine runs with Ubuntu 22.04.

I encountered though one of many problems 22.04 gives me. :angel:

The NAT interface/bridge didn't wanted to start automatically, so I tried to do so myself by saying;
Code
"virsh net-start natbr1"

But then I get greeted with following error message;
Quote
"dnsmasq: failed to create listening socket for 192.168.2.1: Address already in use"

192.168.2.1 is the gateway for my NAT, it doesn't make a difference if I change it to something else.

When I run
Code
"netstat -anup"
I get following results (see attachment(s));
Board Image


This is my netplan .yaml config;
Code

network:
    ethernets:
        enp41s0:
          dhcp4: no
          dhcp6: no
    version: 2
    bridges:
        viifbr0:
          addresses:
            - 144.xxx.xxx.13/32
            - "2a01:xxxxx:xxxx:6305::2/64"
          interfaces: [ enp41s0 ]
          routes:
            - on-link: true
              to: 0.0.0.0/0
              via: 144.xxx.xxx.1
            - on-link: true
              to: default
              via: fe80::1
          macaddress: a8:xx:xx:xx:9a:fb
          nameservers:
            addresses:
              - 8.8.8.8
              - 8.8.4.4
              - 2001:4860:4860::8888
              - 2001:4860:4860::8844


Anyone who has a suggestion what I can, might or should try?
Already thanks in advance for every help!

With kind regards
Pierre
IP: --   

dnsmasq: failed to create listening socket for 192.168.2.1: Address already in use - Ubuntu 22.04
CosmosCraft
Group: Member
Post Group: Newbie
Posts: 5
Status:
Small addition;

this is the full error message I receive upon
Quote
"virsh net-start natbr1"

Code
error: Failed to start network natbr1
error: internal error: Child process (VIR_BRIDGE_NAME=natbr1 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/natbr1.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper) unexpected exit status 2:
dnsmasq: failed to create listening socket for 192.168.2.1: Address already in use



Just noticed that for some reason the attachment for;
Code
"netstat -anup"
got lost, so I'll try it here again
IP: --   

dnsmasq: failed to create listening socket for 192.168.2.1: Address already in use - Ubuntu 22.04
CosmosCraft
Group: Member
Post Group: Newbie
Posts: 5
Status:
A shame, now I got an error message that I can't attach attachments... :P
Well well, here's the content in textform then;

Code
root@host ~ # netstat -anup
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address          Foreign Address        State                                                                                                                                                                    PID/Program name
udp        0      0 0.0.0.0:5353            0.0.0.0:*                                                                                                                                                                                        1218/avahi-daemon:
udp        0      0 0.0.0.0:52081          0.0.0.0:*                                                                                                                                                                                        1218/avahi-daemon:
udp        0      0 144.xxx.xxx.13:53        0.0.0.0:*                                                                                                                                                                                        1408/named
udp        0      0 144.xxx.xxx.13:53        0.0.0.0:*                                                                                                                                                                                        1408/named
udp        0      0 127.0.0.1:53            0.0.0.0:*                                                                                                                                                                                        1408/named
udp        0      0 127.0.0.1:53            0.0.0.0:*                                                                                                                                                                                        1408/named
udp        0      0 127.0.0.53:53          0.0.0.0:*                                                                                                                                                                                        1277/systemd-resolv
udp        0      0 0.0.0.0:67              0.0.0.0:*                                                                                                                                                                                        1745/dhcpd
udp        0      0 127.0.0.1:323          0.0.0.0:*                                                                                                                                                                                        1535/chronyd
udp        0      0 0.0.0.0:631            0.0.0.0:*                                                                                                                                                                                        1743/cups-browsed
udp6      0      0 :::5353                :::*                                                                                                                                                                                            1218/avahi-daemon:
udp6      0      0 :::51051                :::*                                                                                                                                                                                            1218/avahi-daemon:
udp6      0      0 ::1:53                  :::*                                                                                                                                                                                            1408/named
udp6      0      0 ::1:53                  :::*                                                                                                                                                                                            1408/named
udp6      0      0 2a01:xxx:xxx:6305::2:53 :::*                                                                                                                                                                                            1408/named
udp6      0      0 2a01:xxx:xxx:6305::2:53 :::*                                                                                                                                                                                            1408/named
udp6      0      0 fe80::xxx:xxx:fea2:53 :::*                                                                                                                                                                                            1408/named
udp6      0      0 fe80::xxx:xxx:fea2:53 :::*                                                                                                                                                                                            1408/named
udp6      0      0 ::1:323                :::*                                                                                                                                                                                            1535/chronyd
IP: --   

dnsmasq: failed to create listening socket for 192.168.2.1: Address already in use - Ubuntu 22.04
jevingala
Group: Virtualizor Team
Post Group: Super Member
Posts: 744
Status:
Hi,


Can you share output of ifconfig and virsh net-list --all ?

-----------------------
Regards,
Virtualizor Team.
http://virtualizor.com/
IP: --   

dnsmasq: failed to create listening socket for 192.168.2.1: Address already in use - Ubuntu 22.04
CosmosCraft
Group: Member
Post Group: Newbie
Posts: 5
Status:
Quote From : jevingala April 1, 2024, 11:09 am
Hi,


Can you share output of ifconfig and virsh net-list --all ?


Sure, here it is;


Ifconfig;
Code
root@host ~ # ifconfig
enp41s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether a8:a1:xxx:xxx:9a:fb  txqueuelen 1000  (Ethernet)
        RX packets 325941  bytes 46916258 (46.9 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 48246  bytes 14116067 (14.1 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device memory 0xfc200000-fc27ffff

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 7045  bytes 9599521 (9.5 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 7045  bytes 9599521 (9.5 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

viifbr0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 144.xxx.xxx.13  netmask 255.255.255.255  broadcast 0.0.0.0
        inet6 2a01:xxx:xxx:6305::2  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::xxx:xxx:fea2:9afb  prefixlen 64  scopeid 0x20<link>
        ether a8:a1:xxx:xxx:9a:fb  txqueuelen 1000  (Ethernet)
        RX packets 49581  bytes 26790770 (26.7 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 43741  bytes 13831549 (13.8 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


virsh net-list --all
Code
root@host ~ # virsh net-list --all
Name      State      Autostart  Persistent
----------------------------------------------
default  inactive  no          yes
natbr1    inactive  yes        yes



Full syslog when trying to start natbr1;
Code
Apr  1 16:18:59 host NetworkManager[1202]: <info>  [1711981139.2139] manager: (natbr1): new Bridge device (/org/freedesktop/NetworkManager/Devices/9)
Apr  1 16:18:59 host systemd-udevd[44919]: Using default interface naming scheme 'v249'.
Apr  1 16:18:59 host networkd-dispatcher[1214]: WARNING:Unknown index 9 seen, reloading interface list
Apr  1 16:18:59 host avahi-daemon[1199]: Joining mDNS multicast group on interface natbr1.IPv4 with address 192.168.2.1.
Apr  1 16:18:59 host systemd-networkd[1107]: natbr1: Link UP
Apr  1 16:18:59 host avahi-daemon[1199]: New relevant interface natbr1.IPv4 for mDNS.
Apr  1 16:18:59 host avahi-daemon[1199]: Registering new address record for 192.168.2.1 on natbr1.IPv4.
Apr  1 16:18:59 host named[1390]: listening on IPv4 interface natbr1, 192.168.2.1#53
Apr  1 16:18:59 host dnsmasq[44945]: failed to create listening socket for 192.168.2.1: Address already in use
Apr  1 16:18:59 host dnsmasq[44945]: FAILED to start up
Apr  1 16:18:59 host libvirtd[1771]: internal error: Child process (VIR_BRIDGE_NAME=natbr1 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/natbr1.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper) unexpected exit status 2: #012dnsmasq: failed to create listening socket for 192.168.2.1: Address already in use
Apr  1 16:18:59 host systemd-networkd[1107]: natbr1: Link DOWN
Apr  1 16:18:59 host avahi-daemon[1199]: Interface natbr1.IPv4 no longer relevant for mDNS.
Apr  1 16:18:59 host avahi-daemon[1199]: Leaving mDNS multicast group on interface natbr1.IPv4 with address 192.168.2.1.
Apr  1 16:18:59 host avahi-daemon[1199]: Withdrawing address record for 192.168.2.1 on natbr1.
Apr  1 16:18:59 host named[1390]: no longer listening on 192.168.2.1#53

IP: --   

dnsmasq: failed to create listening socket for 192.168.2.1: Address already in use - Ubuntu 22.04
jevingala
Group: Virtualizor Team
Post Group: Super Member
Posts: 744
Status:
Hi,

Can you stop and disable dnsmasq service and then check :

systemctl stop dnsmasq
systemctl disable dnsmasq

-----------------------
Regards,
Virtualizor Team.
http://virtualizor.com/
IP: --   

dnsmasq: failed to create listening socket for 192.168.2.1: Address already in use - Ubuntu 22.04
CosmosCraft
Group: Member
Post Group: Newbie
Posts: 5
Status:
Quote From : jevingala April 2, 2024, 5:34 am
Hi,

Can you stop and disable dnsmasq service and then check :

systemctl stop dnsmasq
systemctl disable dnsmasq


Hello there, and btw, thanks for your responses!

Using:
Code
systemctl stop dnsmasq
systemctl disable dnsmasq

Made sadly no difference.

However, I made a little breakthrough, though it just gives me another headache.

First I installed the full dnsmasq as some people in older threads on other boards recommended to do, to get the /etc/dnsmasq.conf file.

No matter what I change there, I’m unable to start the “service dnsmasq start” service unless I change the port to be 5353 instead of 53.
This doesn’t really make sense, since it doesn’t complain about the port, but the IP address. I can achieve the same by adding the port to the libvirt-daemon found under /etc/dnsmasq.d-available.

But that doesn’t seem to fix 'virsh net-start natbr1'. It still give me the same error.

After Googling the full syslog error message, and a bit of digging, I found a thread recommending to disable “Bind9” and see there, 'virsh net-start natbr1' is now starting like a charm.
The DOWNSIDE is, though, that besides Virtualizor, there's also a Plesk installation that uses Bind9 for its DNS/Domain services on the host system.

I don’t really get why this all of a sudden is an issue, since I use the same setup on my old server running Ubuntu 20.04.
I’m able to stop Bind9, start the bridge, and then start Bind9 without any problems. I’ll have to observe if they collide somehow.
But that isn’t a perma fix, since I have to do so every reboot or in worst case automate that process after boot is complete, since Bind9 starts before the bridge

Anyone who might have an idea why it suddenly is a problem to run dnsmasq in combination with Bind9?



IP: --   

« Previous    Next »

Threaded Mode | Print  



Jump To :


Users viewing this topic
1 guests, 0 users.


All times are GMT. The time now is May 26, 2024, 11:13 am.

  Powered By AEF 1.0.8 © 2007-2008 Electron Inc.Queries: 10  |  Page Created In:0.185