Dnsmasq 未作为 dhcp 服务器分配地址

Dnsmasq 未作为 dhcp 服务器分配地址

我有一台 Debian Linux 服务器,通过以太网电缆连接到 Netgear 接入点(Wnr2000)。

我希望所有通过无线连接到接入点的用户都以 Debian Linux 服务器作为网关。

Netgear wnr2000 不允许我这样做,所以我考虑关闭它的 dhcp 服务器并使用 dnsmasq(如下方答案所建议的)作为 dhcp 服务器。

我有我的 dnsmasq.conf:

expand-hosts
domain=test.com
dhcp-range=192.168.1.40,128.0.1.99,12h
dhcp-option=1,255.255.255.0
dhcp-option=3,192.168.1.100
dhcp-option=6,192.168.1.100

我的 Netgear 有一个静态配置:192.168.1.1,而我的 Debian 服务器是(始终是静态的):192.168.1.100

看起来我的 IP 没有被 dnsmasq dhcp 服务器分配...

怎么了?

更新

dnsmasq 正在运行,这是我的 ps aux | grep dnsmasq:

dnsmasq   2974  0.0  0.1   4732   924 ?        S    14:13   0:00 /usr/sbin/dnsma                                                                                                             sq -x /var/run/dnsmasq/dnsmasq.pid -u dnsmasq -7 /etc/dnsmasq.d,.dpkg-dist,.dpkg                                                                                                             -old,.dpkg-new
root     20772  0.0  0.1   3540   868 pts/2    S+   21:13   0:00 grep --color=au                                                                                                             to dnsmasq

答案1

您的客户端可能通过 Netgear 的 DHCP 获取其 IP 地址(以及网关)。如果您禁用 Netgear 上的 DHCP 服务器并在 RPi 上运行它,您将能够指定您希望客户端拥有的任何网关。

答案2

我的 dnsmasq.conf 错误(请检查 IP 范围)。

正确的是:

expand-hosts
domain=test.com
dhcp-range=192.168.1.40,192.168.1.99,12h
dhcp-option=1,255.255.255.0
dhcp-option=3,192.168.1.100
dhcp-option=6,192.168.1.100

相关内容