【发布时间】:2018-01-24 17:35:24
【问题描述】:
我有一个 dnsmasq 服务器,用于提供 DHCP 和缓存 DNS。它在树莓派上运行。池中可用的地址范围对于定期进入和离开网络的设备数量来说太小了,所以我试图让它为来自不同子网的地址提供服务,但使用相同的网关。但它只是从一个范围内分配。
有很多关于如何根据哪个 NIC 为请求或 MAC 地址分配不同子网的建议,但没有关于以这种方式从单个 NIC 组合子网并让它们使用单个网关的建议。那里的情况表明下面的设置应该可以正常工作,但实际上并没有。
手册页也无济于事。
情况:
router/gateway: 192.168.1.1
DNS/DHCP: 192.168.1.2
reserved: 192.168.1.3-150
在 DNS 服务器上: /etc/网络/接口
auto eth0
auto lo
iface lo inet loopback
iface eth0 inet static
address 192.168.1.2
gateway 192.168.1.1
netmask 255.255.0.0
network 192.168.0.0
broadcast 192.168.1.255
在 DNS 服务器上 /etc/dnsmasq.conf
#/etc/dnsmasq.conf
domain-needed
bogus-priv
domain=local.net
expand-hosts
local=/local.net/
listen-address=192.168.1.2
bind-interfaces
cache-size=1000
dhcp-authoritative
dhcp-leasefile=/var/lib/dhcp/dhcpd.leases
dhcp-range=eth0,192.168.1.150,192.168.1.250,255.255.0.0,24h
dhcp-range=eth0,192.168.2.10,192.168.2.250,255.255.0.0,24h
dhcp-range=eth0,192.168.3.10,192.168.3.250,255.255.0.0,24h
dhcp-range=eth0,192.168.4.10,192.168.4.250,255.255.0.0,24h
dhcp-option=3,192.168.1.1
dhcp-option=6,192.168.1.2
dhcp-option=42,192.168.1.2
server=8.8.8.8
server=8.8.4.4
server=208.67.220.220
【问题讨论】:
标签: networking dns dhcp subnet dnsmasq