dnsmasq:DHCPサーバーソケットをバインドできません:アドレスはすでに使用されています。

dnsmasq:DHCPサーバーソケットをバインドできません:アドレスはすでに使用されています。

PXEサーバーとして設定されたボックスがあります。 DHCPリースを提供するインターフェイスはeno3です。 dnsmasqがインストールされており、tftpサービスを提供しています**バインドがインストールされていません - Ubunutu 18.04 **

Error: dnsmasq: failed to bind DHCP server socket: Address already in use

しかし、netstat は dnsmasq がポート 67 を制御することを示しています。 (DHCP)

誰かがこのエラーが発生する理由を教えてもらえますか?

netplan yaml、ifconfig、netstat -aunp、dnsmasqの実行エラーは次のとおりです。

root@pxebooter:~# dnsmasq
dnsmasq: failed to bind DHCP server socket: Address already in use

root@pxebooter:~# more /etc/netplan/50-cloud-init.yaml
# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
      version: 2
#     renderer: networkd
      ethernets:
        eno1:
            addresses: [10.1.9.199/24]
            gateway4: 10.1.9.254
            nameservers:
                    addresses: [205.171.3.65,205.171.2.65]
            dhcp4: false
        eno2:
            addresses: [10.1.100.11/24]
            gateway4: 10.1.100.100
            dhcp4: false
            optional: false

        eno3:
            addresses: [10.1.200.1/24]
            gateway4: 10.1.200.1
            dhcp4: false
            optional: false

root@pxebooter:~# ifconfig
eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.1.9.199  netmask 255.255.255.0  broadcast 10.1.9.255
        inet6 fe80::1618:77ff:fe60:c571  prefixlen 64  scopeid 0x20<link>
        ether 14:18:77:60:c5:71  txqueuelen 1000  (Ethernet)
        RX packets 7695  bytes 1124240 (1.1 MB)
        RX errors 0  dropped 742  overruns 0  frame 0
        TX packets 2133  bytes 228533 (228.5 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 94

eno2: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 14:18:77:60:c5:72  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 95

eno3: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 14:18:77:60:c5:73  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 97

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 130  bytes 10266 (10.2 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 130  bytes 10266 (10.2 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

root@pxebooter:~# grep -v '^#' /etc/dnsmasq.conf
port=0
interface=eno3
dhcp-range=100.1.200.50,10.1.200.150,12h
dhcp-boot=pxelinux.0
enable-tftp
tftp-root=/home/pxe
tftp-no-fail
dhcp-lease-max=99
dhcp-leasefile=/home/pxe/leases
dhcp-authoritative
dhcp-script=/bin/echo

root@pxebooter:~# netstat -aunp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
udp    15360      0 127.0.0.53:53           0.0.0.0:*                           1356/systemd-resolv
udp    33600      0 0.0.0.0:67              0.0.0.0:*                           1877/dnsmasq
udp        0      0 0.0.0.0:69              0.0.0.0:*                           1877/dnsmasq
udp6       0      0 :::69                   :::*                                1877/dnsmasq

root@pxebooter:~# tftp localhost
tftp> get test.txt
Received 17 bytes in 0.0 seconds
tftp> quit

root@pxebooter:~# dnsmasq
dnsmasq: failed to bind DHCP server socket: Address already in use
root@pxebooter:~# dnsmasq -h

ベストアンサー1

それは本当に恥ずかしいです。

eno3がネットワークアドレスにバインドできない理由は、私のネットワークアドレスが間違っているためです。まず、システムログを見てください。

Aug 14 10:47:52 pxebooter systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.
Aug 14 10:49:02 pxebooter dnsmasq-dhcp[2769]: DHCP range 10.1.200.150 -- 100.1.200.50 is not consistent with netmask 255.255.255.0
Aug 14 10:49:02 pxebooter dnsmasq-dhcp[2769]: no address range available for DHCP request via eno3

明らかに、10.xxxと100.xxxは/ 24サブネットマスクの範囲内にありません。

私は余分なゼロに気づいていないので、どのくらいの時間を無駄にしたかを認めたくありません。

みんなの助けに感謝します。

おすすめ記事