DHCP 发现被忽略

DHCP 发现被忽略

我设置的 DHCP 服务器确实存在一些问题。我束手无策,找不到任何可以解决这个问题的方法。

设置如下:我有一台 CentOS 服务器,运行 ISC 的 DHCP 服务器。这台机器有两个连接到同一网络的接口,我们称之为 eth0 和 eth1。

这两个 NIC 所连接的网络是172.31.255.0/24。在这个网络上,eth0172.31.255.21eth1172.31.255.22。网关的 IP 地址是172.31.255.254。DHCP 服务器应仅在接口 eth1 ( 172.31.255.22) 上运行。

来自 WLAN 的 DHCP 请求正在被中继,并将通过网关到达。网关有一个 DHCP 中继,它正在抓取来自 WLAN 客户端的请求并将其转换为单播 DHCP 请求。

来自 WLAN 的 DHCP 请求到达了服务器的网络(tcpdump 正在捕获它们),但服务器根本没有响应。日志也没有显示任何内容。更具体地说,中继器将 DHCPDISCOVER 请求发送到 eth1,但 DHCP 服务器没有响应。

服务器应该172.31.255.0/24向 WLAN 客户端 ( 172.31.1.254/23) 发放一个不属于其本地网络 ( ) 的 IP 地址。

以下是 DHCP 发现示例:

16:13:37.629817  In 00:90:7f:d0:61:39 ethertype IPv4 (0x0800), length 347: (tos 0x0, ttl 64, id 25877, offset 0, flags [DF], proto UDP (17), length 331)
172.31.255.254.bootps > 172.31.255.22.bootps: [udp sum ok] BOOTP/DHCP, Request from 18:3d:a2:78:82:78, length 303, hops 1, xid 0xa5cdb9df, secs 7680, Flags [Broadcast] (0x8000)
      Gateway-IP 172.31.1.254
      Client-Ethernet-Address 18:3d:a2:78:82:78
      Vendor-rfc1048 Extensions
        Magic Cookie 0x63825363
        DHCP-Message Option 53, length 1: Discover
        Client-ID Option 61, length 7: ether 18:3d:a2:78:82:78
        Hostname Option 12, length 12: "WIN-SURVEYPC"
        Vendor-Class Option 60, length 8: "MSFT 5.0"
        Parameter-Request Option 55, length 12:
          Subnet-Mask, Domain-Name, Default-Gateway, Domain-Name-Server
          Netbios-Name-Server, Netbios-Node, Netbios-Scope, Router-Discovery
          Static-Route, Classless-Static-Route, Classless-Static-Route-Microsoft, Vendor-Option
        Agent-Information Option 82, length 10:
          Circuit-ID SubOption 1, length 8: vlan2000
        END Option 255, length 0

DHCP 的服务器配置如下(接口 eth1 作为启动参数):

log-facility local6;
authoritative;

# Management Subnet
subnet 172.31.255.0 netmask 255.255.255.0 {
        option ntp-servers 172.31.255.20 , 172.31.255.21;
        option domain-name-servers 172.31.255.20 , 172.31.255.21;
        option broadcast-address 172.31.255.255;
        option routers 172.31.255.254;
        range 172.31.255.100 172.31.255.200;
}
# Guest_0
subnet 172.31.0.0 netmask 255.255.254.0 {
        option broadcast-address 172.31.1.255;
        option domain-name-servers 172.31.255.20 , 172.31.255.21;
        option routers 172.31.1.254;
        range 172.31.0.1 172.31.1.250;
}
# Guest_2
subnet 172.31.2.0 netmask 255.255.254.0 {
        option domain-name-servers 172.31.255.20, 172.31.255.21;
        option broadcast-address 172.31.3.255;
        option subnet-mask 255.255.254.0;
        option routers 172.31.3.254;
        range 172.31.2.1 172.31.3.250;
}

这是服务器启动后的初始消息:

Nov 11 16:01:05 centos2 dhcpd: Internet Systems Consortium DHCP Server 4.2.5
Nov 11 16:01:05 centos2 dhcpd: Copyright 2004-2013 Internet Systems Consortium.
Nov 11 16:01:05 centos2 dhcpd: All rights reserved.
Nov 11 16:01:05 centos2 dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Nov 11 16:01:05 centos2 dhcpd: Wrote 3 leases to leases file.
Nov 11 16:01:05 centos2 dhcpd: Multiple interfaces match the same subnet: eth0 eth1
Nov 11 16:01:05 centos2 dhcpd: Multiple interfaces match the same shared network: eth0 eth1
Nov 11 16:01:05 centos2 dhcpd: Listening on LPF/eth1/00:50:56:a8:7d:ed/172.31.255.0/24
Nov 11 16:01:05 centos2 dhcpd: Sending on   LPF/eth1/00:50:56:a8:7d:ed/172.31.255.0/24
Nov 11 16:01:05 centos2 dhcpd: Sending on   Socket/fallback/fallback-net

路由表如下:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         172.31.255.254  0.0.0.0         UG    0      0        0 eth0
link-local      0.0.0.0         255.255.0.0     U     1002   0        0 eth0
172.31.255.0    0.0.0.0         255.255.255.0   U     0      0        0 eth0
172.31.255.0    0.0.0.0         255.255.255.0   U     0      0        0 eth1

任何帮助都将不胜感激。感谢您的时间!

相关内容