DHCP(dnsmasq)分配错误的 IP(openSUSE 升级后)

DHCP(dnsmasq)分配错误的 IP(openSUSE 升级后)

设置: 我有两台服务器 A 和 B。服务器 A 运行 dnsmasq,应该为 B 分配一个静态 IP(使用主机名“vm03”)。此 IP 设置在/etc/dnsmasq.conf(以下摘录):

domain-needed
local=/my-private-domain/
interface=eth0
interface=eth1
interface=tun0
dhcp-range=192.168.100.100,192.168.100.130
dhcp-host=vm03,192.168.100.103

问题:这曾经工作得很好,但是在我将服务器 B 从 openSUSE 13.1 升级到 42.1 之后,它不再工作了 = 服务器 B 不再被分配 192.168.100.103,而是分配一些不同的 IP 地址,例如 192.160.100.124(仍然在我上面定义的一般 IP 范围内)。

在服务器 AI 上,dnsmasq 本身意识到有些不对劲(因为我还在/etc/hosts服务器A的文件):

dnsmasq-dhcp:未将名称 vm03 授予 DHCP 租约 192.168.100.124,因为该名称存在于地址为 192.168.100.103 的 /etc/hosts 中

TCP转储:我比较了“tcpdump -i eth1 -vvv -s 0 端口 bootps“来自服务器 B 的输出与来自服务器 C 的输出(仍然运行旧的 openSUSE 13.1 并从 dnsmasq 获取正确的 IP)。

旧服务器 C 与 A 的通信 [发现、提供、请求 ACK]。完整跟踪这里

lsm1:~ # tcpdump -i eth1  port 67 or port 68 -e -n
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 65535 bytes
13:31:51.106018 52:54:00:bd:8a:6e > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 52:54:00:bd:8a:6e, length 300
13:31:51.106369 52:54:00:a3:7c:db > 52:54:00:bd:8a:6e, ethertype IPv4 (0x0800), length 342: 192.168.100.1.67 > 192.168.100.102.68: BOOTP/DHCP, Reply, length 300
13:31:51.106752 52:54:00:bd:8a:6e > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 354: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 52:54:00:bd:8a:6e, length 312
13:31:51.263232 52:54:00:a3:7c:db > 52:54:00:bd:8a:6e, ethertype IPv4 (0x0800), length 346: 192.168.100.1.67 > 192.168.100.102.68: BOOTP/DHCP, Reply, length 304

新服务器 B 与 A 的通信 [请求、NACK、发现、提供、请求、ACK]。完整跟踪这里

lsm1:~ # tcpdump -i eth1  port 67 or port 68 -e -n
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 65535 bytes
13:31:59.743740 52:54:00:be:0b:ab > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 52:54:00:be:0b:ab, length 300
13:31:59.744122 52:54:00:a3:7c:db > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: 192.168.100.1.67 > 255.255.255.255.68: BOOTP/DHCP, Reply, length 300
13:32:00.744866 52:54:00:be:0b:ab > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 52:54:00:be:0b:ab, length 300
13:32:00.745244 52:54:00:a3:7c:db > 52:54:00:be:0b:ab, ethertype IPv4 (0x0800), length 342: 192.168.100.1.67 > 192.168.100.124.68: BOOTP/DHCP, Reply, length 300
13:32:00.745711 52:54:00:be:0b:ab > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 351: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 52:54:00:be:0b:ab, length 309
13:32:00.813972 52:54:00:a3:7c:db > 52:54:00:be:0b:ab, ethertype IPv4 (0x0800), length 346: 192.168.100.1.67 > 192.168.100.124.68: BOOTP/DHCP, Reply, length 304

我不知道为什么行为会改变。这是正确的还是有问题邪恶? 有什么想法/事情要测试吗?


我已经检查/尝试

  1. 服务器 B 上的网络设置保持不变(唯一不同之处是:升级后它不再由启动/停止邪恶)。
  2. 我手动删除了租约文件/var/lib/misc/dnsmasq.leases
  3. 在服务器 A 上重新启动 dnsmasq,并通过以下方式在服务器 B 上强制更新 IPifup eth0

答案1

为了获取正确的 IP 地址,dnsmasq.conf还必须配置 MAC 地址。

dhcp-host=11:22:33:44:55:66,fvm03,192.168.100.103

相关内容