/var/log/messages 中的 DHCP 请求过多:DHCPINFORM、DHCPACK 和 DHCPREQUEST 重复

/var/log/messages 中的 DHCP 请求过多:DHCPINFORM、DHCPACK 和 DHCPREQUEST 重复

我有一个 CentOS 5 系统,为多个子网运行 DHCP。在 /var/log/messages 中,我看到了持续不断的 DHCPINFORM、DHCPACK 和 DHCPREQUEST 消息。我不明白为什么这些请求在这里比其他安装更频繁。这些消息每隔几秒钟就会突然出现,导致日志文件非常大。

这里的大部分设备都是无线手持设备(使用 Windows CE TCP 堆栈)。如果您能提供任何有关如何平息这些持续不断的消息的见解,我将不胜感激。

/etc/dhcpd.conf

default-lease-time 28800;
authoritative;
allow bootp;
ddns-update-style none;
option subnet-mask 255.255.255.0;
option domain-name-servers  10.1.1.3;
option domain-name "xxxinc.com";
option tftp-server-name "10.1.1.3";
option ntp-servers 17.151.16.21;

subnet 10.1.1.0 netmask 255.255.255.0 {
        range dynamic-bootp 10.1.1.120 10.1.1.211;
        option tftp-server-name "10.1.1.3";
        next-server 10.1.1.3;
        filename "/dsl/pxelinux.0";
        option routers 10.1.1.1;
}

subnet 10.1.2.0 netmask 255.255.255.0 {
        range dynamic-bootp 10.1.2.130 10.1.2.199;
        option tftp-server-name "10.1.1.3";
        next-server 10.1.1.3;
        filename "/dsl/pxelinux.0";
        option routers 10.1.2.1;
}

/var/log/消息

Apr  4 10:59:44 General dhcpd: DHCPINFORM from 10.1.1.136 via eth0
Apr  4 10:59:44 General dhcpd: DHCPACK to 10.1.1.136 (00:16:35:07:1e:61) via eth0
Apr  4 10:59:44 General dhcpd: DHCPINFORM from 10.1.1.136 via eth0
Apr  4 10:59:44 General dhcpd: DHCPACK to 10.1.1.136 (00:16:35:07:1e:61) via eth0
Apr  4 10:59:44 General dhcpd: DHCPINFORM from 10.1.1.136 via 10.1.1.254
Apr  4 10:59:44 General dhcpd: DHCPACK to 10.1.1.136 (00:16:35:07:1e:61) via eth0
Apr  4 10:59:44 General dhcpd: DHCPINFORM from 10.1.1.136 via 10.1.1.254
Apr  4 10:59:44 General dhcpd: DHCPACK to 10.1.1.136 (00:16:35:07:1e:61) via eth0
Apr  4 10:59:44 General dhcpd: DHCPINFORM from 10.1.1.136 via 10.1.1.2
Apr  4 10:59:44 General dhcpd: DHCPACK to 10.1.1.136 (00:16:35:07:1e:61) via eth0
Apr  4 10:59:46 General dhcpd: DHCPREQUEST for 10.1.1.137 from 00:15:70:85:9b:ea via eth0
Apr  4 10:59:46 General dhcpd: DHCPACK on 10.1.1.137 to 00:15:70:85:9b:ea via eth0
Apr  4 10:59:46 General dhcpd: DHCPREQUEST for 10.1.1.137 from 00:15:70:85:9b:ea via eth0
Apr  4 10:59:46 General dhcpd: DHCPACK on 10.1.1.137 to 00:15:70:85:9b:ea via eth0
Apr  4 10:59:46 General dhcpd: DHCPREQUEST for 10.1.1.137 from 00:15:70:85:9b:ea via 10.1.1.254
Apr  4 10:59:46 General dhcpd: DHCPACK on 10.1.1.137 to 00:15:70:85:9b:ea via 10.1.1.254
Apr  4 10:59:46 General dhcpd: DHCPREQUEST for 10.1.1.137 from 00:15:70:85:9b:ea via 10.1.1.254
Apr  4 10:59:46 General dhcpd: DHCPACK on 10.1.1.137 to 00:15:70:85:9b:ea via 10.1.1.254
Apr  4 10:59:46 General dhcpd: DHCPREQUEST for 10.1.1.137 from 00:15:70:85:9b:ea via 10.1.1.2
Apr  4 10:59:46 General dhcpd: DHCPACK on 10.1.1.137 to 00:15:70:85:9b:ea via 10.1.1.2
Apr  4 10:59:47 General dhcpd: DHCPINFORM from 10.1.2.193 via 10.1.2.1
Apr  4 10:59:47 General dhcpd: DHCPACK to 10.1.2.193 (00:1a:4b:c0:e0:a4) via eth0
Apr  4 10:59:47 General dhcpd: DHCPINFORM from 10.1.1.147 via eth0
Apr  4 10:59:47 General dhcpd: DHCPACK to 10.1.1.147 (00:19:bb:d3:bc:e8) via eth0
Apr  4 10:59:47 General dhcpd: DHCPINFORM from 10.1.1.147 via eth0
Apr  4 10:59:47 General dhcpd: DHCPACK to 10.1.1.147 (00:19:bb:d3:bc:e8) via eth0
Apr  4 10:59:47 General dhcpd: DHCPINFORM from 10.1.1.147 via 10.1.1.254
Apr  4 10:59:47 General dhcpd: DHCPACK to 10.1.1.147 (00:19:bb:d3:bc:e8) via eth0
Apr  4 10:59:47 General dhcpd: DHCPINFORM from 10.1.1.147 via 10.1.1.254
Apr  4 10:59:47 General dhcpd: DHCPACK to 10.1.1.147 (00:19:bb:d3:bc:e8) via eth0
Apr  4 10:59:47 General dhcpd: DHCPINFORM from 10.1.1.147 via 10.1.1.2
Apr  4 10:59:47 General dhcpd: DHCPACK to 10.1.1.147 (00:19:bb:d3:bc:e8) via eth0
Apr  4 10:59:49 General dhcpd: DHCPREQUEST for 10.1.1.198 from 00:15:70:86:dc:b9 via eth0
Apr  4 10:59:49 General dhcpd: DHCPACK on 10.1.1.198 to 00:15:70:86:dc:b9 via eth0
Apr  4 10:59:49 General dhcpd: DHCPREQUEST for 10.1.1.198 from 00:15:70:86:dc:b9 via eth0
Apr  4 10:59:49 General dhcpd: DHCPACK on 10.1.1.198 to 00:15:70:86:dc:b9 via eth0
Apr  4 10:59:49 General dhcpd: DHCPREQUEST for 10.1.1.198 from 00:15:70:86:dc:b9 via 10.1.1.254
Apr  4 10:59:49 General dhcpd: DHCPACK on 10.1.1.198 to 00:15:70:86:dc:b9 via 10.1.1.254
Apr  4 10:59:49 General dhcpd: DHCPREQUEST for 10.1.1.198 from 00:15:70:86:dc:b9 via 10.1.1.254
Apr  4 10:59:49 General dhcpd: DHCPACK on 10.1.1.198 to 00:15:70:86:dc:b9 via 10.1.1.254
Apr  4 10:59:49 General dhcpd: DHCPREQUEST for 10.1.1.198 from 00:15:70:86:dc:b9 via 10.1.1.2
Apr  4 10:59:49 General dhcpd: DHCPACK on 10.1.1.198 to 00:15:70:86:dc:b9 via 10.1.1.2

更新

我已经从某些 DHCP 服务器端路由器中删除了一些多余的ip helper-address条目。大部分流量已经减少,但是我仍然收到大量 DHCPINFORM、DHCPACK...

Oct 26 17:22:23 General dhcpd: DHCPINFORM from 10.1.1.140 via eth0
Oct 26 17:22:23 General dhcpd: DHCPACK to 10.1.1.140 (00:16:35:07:1e:2c) via eth0
Oct 26 17:22:27 General dhcpd: DHCPINFORM from 10.1.1.147 via eth0
Oct 26 17:22:27 General dhcpd: DHCPACK to 10.1.1.147 (00:19:bb:d3:bc:e8) via eth0
Oct 26 17:22:27 General dhcpd: DHCPINFORM from 10.1.1.140 via eth0
Oct 26 17:22:27 General dhcpd: DHCPACK to 10.1.1.140 (00:16:35:07:1e:2c) via eth0
Oct 26 17:22:39 General dhcpd: DHCPINFORM from 10.1.1.182 via eth0
Oct 26 17:22:39 General dhcpd: DHCPACK to 10.1.1.182 (00:19:bb:d3:ec:f1) via eth0
Oct 26 17:22:43 General dhcpd: DHCPINFORM from 10.1.1.182 via eth0
Oct 26 17:22:43 General dhcpd: DHCPACK to 10.1.1.182 (00:19:bb:d3:ec:f1) via eth0
Oct 26 17:22:49 General dhcpd: DHCPINFORM from 10.1.2.198 via 10.1.2.1
Oct 26 17:22:49 General dhcpd: DHCPACK to 10.1.2.198 (00:1e:0b:79:e5:15) via eth0
Oct 26 17:23:01 General dhcpd: DHCPINFORM from 10.1.1.194 via eth0
Oct 26 17:23:01 General dhcpd: DHCPACK to 10.1.1.194 (00:1e:0b:7b:2d:d6) via eth0
Oct 26 17:23:04 General dhcpd: DHCPINFORM from 10.1.1.136 via eth0
Oct 26 17:23:04 General dhcpd: DHCPACK to 10.1.1.136 (00:16:35:07:1e:61) via eth0
Oct 26 17:23:07 General dhcpd: DHCPINFORM from 10.1.1.136 via eth0
Oct 26 17:23:07 General dhcpd: DHCPACK to 10.1.1.136 (00:16:35:07:1e:61) via eth0
Oct 26 17:23:09 General dhcpd: DHCPINFORM from 10.1.2.193 via 10.1.2.1
Oct 26 17:23:09 General dhcpd: DHCPACK to 10.1.2.193 (00:1a:4b:c0:e0:a4) via eth0
Oct 26 17:23:12 General dhcpd: DHCPINFORM from 10.1.2.179 via 10.1.2.1
Oct 26 17:23:12 General dhcpd: DHCPACK to 10.1.2.179 (00:19:bb:d3:f6:26) via eth0
Oct 26 17:23:13 General dhcpd: DHCPINFORM from 10.1.2.193 via 10.1.2.1
Oct 26 17:23:13 General dhcpd: DHCPACK to 10.1.2.193 (00:1a:4b:c0:e0:a4) via eth0
Oct 26 17:23:15 General dhcpd: DHCPINFORM from 10.1.2.179 via 10.1.2.1
Oct 26 17:23:15 General dhcpd: DHCPACK to 10.1.2.179 (00:19:bb:d3:f6:26) via eth0
Oct 26 17:23:36 General dhcpd: DHCPINFORM from 10.1.1.140 via eth0
Oct 26 17:23:36 General dhcpd: DHCPACK to 10.1.1.140 (00:16:35:07:1e:2c) via eth0
Oct 26 17:23:37 General dhcpd: DHCPINFORM from 10.1.1.147 via eth0
Oct 26 17:23:37 General dhcpd: DHCPACK to 10.1.1.147 (00:19:bb:d3:bc:e8) via eth0
Oct 26 17:23:40 General dhcpd: DHCPINFORM from 10.1.1.140 via eth0
Oct 26 17:23:40 General dhcpd: DHCPACK to 10.1.1.140 (00:16:35:07:1e:2c) via eth0
Oct 26 17:23:41 General dhcpd: DHCPINFORM from 10.1.1.147 via eth0
Oct 26 17:23:41 General dhcpd: DHCPACK to 10.1.1.147 (00:19:bb:d3:bc:e8) via eth0
Oct 26 17:23:50 General dhcpd: DHCPINFORM from 10.1.2.198 via 10.1.2.1
Oct 26 17:23:50 General dhcpd: DHCPACK to 10.1.2.198 (00:1e:0b:79:e5:15) via eth0
Oct 26 17:23:51 General dhcpd: DHCPINFORM from 10.1.1.182 via eth0
Oct 26 17:23:51 General dhcpd: DHCPACK to 10.1.1.182 (00:19:bb:d3:ec:f1) via eth0

答案1

看起来您的客户端连接到了多个子网(或路由器正在相互中继 dhcp 帮助程序)。由于我不了解您的拓扑,所以我不能肯定地说。

需要检查以下几件事:

  1. 所有客户端都会发生这种情况吗?还是只有位于特定网段的客户端才会发生这种情况?
  2. 这些客户端是否连接到多个子网?
  3. 您是否已验证您的子网之间没有桥接?

您应该查看每个客户端(可能使用 ethreal),并确定它们是否从多个路由器接收多个 DHCPACK(可能正在接收)。

答案2

如果 DHCPACK 响应中没有指定 WPAD 选项,某些客户端(尤其是 Windows 7)会不断发送 DHCPINFORM 消息。

您可以通过在配置中添加以下几行来修复 ISC DHCP 的问题:

option wpad code 252 = text;

subnet xxx {
    option wpad "\n";
}

您可以通过将以下内容添加到 dnsmasq.conf 文件来修复 dnsmasq 的这个问题:

dhcp-option=252,"\n"

答案3

您的 DHCP 服务器似乎多次使用不同的套接字监听同一个接口(查看“via”位 - 它涉及 eth0 和两个不同的 IP 地址)。如果您已明确配置 DHCP 服务器的监听套接字,请检查每个接口是否只有一个套接字。

除此之外,流量看起来很正常。Windows 主机经常使用 DHCPINFORM 查询未缓存的其他参数,而且 WinCE 的缓存也很小。

答案4

如果该机器上有“DHCP 管理器”UI,您是否尝试过增加 dhcpd 守护进程的详细程度?想知道您是否从此操作中得到了有关该问题的其他线索。或者在启用详细程度和事务日志的情况下重新启动:

# /etc/init.d/dhcp stop
# /usr/lib/inet/in.dhcpd -v -l 5 [options]

其中 /etc/syslog.conf 包含:

local0.notice              /var/log/dhcpsrvc 

相关内容