【问题标题】:How do I setup dnsmasq to serve address from multiple ranges with the same gateway to combat address exhaustion?如何设置 dnsmasq 以使用同一网关从多个范围提供地址以对抗地址耗尽?
【发布时间】: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


    【解决方案1】:

    上面的方案尝试设置4个vlan:

    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
    

    但答案只是增加单个vlan中的范围(当然):

    dhcp-range=eth0,192.168.1.150,192.168.4.250,255.255.0.0,24h
    

    【讨论】:

      猜你喜欢
      • 2013-08-09
      • 1970-01-01
      • 2020-10-30
      • 1970-01-01
      • 2019-04-22
      • 1970-01-01
      • 2014-07-31
      • 2010-10-20
      • 1970-01-01
      相关资源
      最近更新 更多