大网数据广告活动
服务器运维问答

How to discard a DHCP request's old IP address (and provide a new one)?

· 52CE 我爱测

I switched from a 192.168.0.0/24 network to 10.10.10.0/24 . The addresses are provided by dnsmasq-dhcp . The switch went fine for all devices but one - a printer (called PRINTER ). This printer was assigned a fixed IP based on it…

问题原文

原帖链接 · WoJ · CC BY-SA 3.0

I switched from a 192.168.0.0/24 network to 10.10.10.0/24. The addresses are provided by dnsmasq-dhcp.

The switch went fine for all devices but one - a printer (called PRINTER). This printer was assigned a fixed IP based on its name defined in /etc/hosts (via dhcp-host=PRINTER) and still does with the new ranges.

When it requests an IP address, the DHCP server states in its logs that

dnsmasq-dhcp:  not giving name PRINTER to the DHCP lease of 192.168.0.20 because the name exists in /etc/hosts with address 10.10.10.20

I do not understand this message: the name indeed exists in /etc/hosts, with now the new 10.10.10.20 address. While I guess that the DHCP query from the printer hints about the old IP address it used to have, why doesn't dnsmasq just ignore that and provide the new IP address?

已采纳解答

原帖链接 · arana · CC BY-SA 3.0

Check if your printer name for old ip is here: /var/lib/misc/dnsmasq.leases and edit that file, you must stop dnsmask first

check the Lease times you setup when you configured dhcp, if you assigned too much time then it will take a while to "fix "itself

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-03-18)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。