目录
环境
电脑为Manjaro, KDE环境, 已经配置ipv4地址 192.168.201.182/24
计划使用kea做DHCP服务器,
配置新的192.168.182.1 ip地址作为DHCPv4服务器地址
(原本想直接用配置里的192.0.2.0/24做DHCP服务的)
现象
设备无法通过电脑获取DHCP地址
wireshark看抓包, 有DHCP Request, 但是电脑没有回复消息
通过sudo systemctl status kea-dhcp4.service
查看服务正常运行
点开配置文件确认日志输出(还要配置日志等级DEBUG
, 输出详细程度为99
, 然后重启服务),
发现select subnet报错No subnet matches interface
, 以及 No subnet matches address
2025-01-13 22:36:30.340 DEBUG [kea-dhcp4.dhcpsrv/10824.125053594990272] DHCPSRV_SUBNET4_SELECT_BY_INTERFACE_NO_MATCH No subnet matches interface: enp6s0
2025-01-13 22:36:30.340 DEBUG [kea-dhcp4.bad-packets/10824.125053603382976] DHCP4_PACKET_DROP_0002 [hwtype=1 mac略], cid=[略], tid=0x9a7b7542, from interface enp6s0: no suitable subnet configured for a direct client
2025-01-13 22:36:30.340 DEBUG [kea-dhcp4.dhcpsrv/10824.125053594990272] DHCPSRV_SUBNET4_SELECT_BY_ADDRESS_NO_MATCH No subnet matches address: 192.168.201.182
结论
好像kea要求配置的地址是网卡的第一个地址了
去网络设置里调整手动配置ip的顺序, 把用作dhcp网关的地址写在第一个, kea-dhcp4服务就能正常分发地址了
日志变成
2025-01-13 22:36:44.412 DEBUG [kea-dhcp4.dhcpsrv/10980.130947699795648] DHCPSRV_SUBNET4_SELECT_BY_INTERFACE_NO_MATCH No subnet matches interface: enp6s0
2025-01-13 22:36:44.412 DEBUG [kea-dhcp4.dhcpsrv/10980.130947699795648] DHCPSRV_CFGMGR_SUBNET4_ADDR selected subnet 192.168.182.0/24 for packet received by matching address 192.168.182.1
服务器设置成192.0.2.0/24, 电脑设置ip为192.0.2.1 忘记测试, 但感觉过去应该和这个ip带0关系不大
标签:subnet,dhcp4,No,matches,kea,报错,DEBUG From: https://www.cnblogs.com/SendBoringBackToNoWhere/p/18669586