configurationDHCP服务器在同一个具有多个接口的子网上为两个不同的作用域提供服务

好吧,我在Debian Wheezy服务器上遇到一个非常复杂的问题

我在一台服务器上有三个接口:eth0,eth1和wlan0,eth0将作为eth1和wlan0的网关,在服务器上有一个isc-dhcp-server。 我在192.168.0.0(服务192.168.0.1到192.168.0.254)上有一个IP class-C范围eth0在192.168.0.1上wlan0在192.168.0.63上wlan0充当接入点

他们每个人都需要服务60个IP地址eth0从192.168.0.2到192.168.0.62 wlan0从192.168.0.66到192.168.0.126

我想要做的是快速识别以太网或无线设备的方法

所以我用这四个configuration文件运行dhcp服务器:

的/etc/dhcp/dhcpd.conf

ddns-update-style none; option domain-name "me.fr"; option domain-name-servers 192.168.0.1; default-lease-time -1; max-lease-time -1; authoritative; log-facility local7; #ethernet subnet 192.168.0.0 netmask 255.255.255.192 { option routers 192.168.0.1; option subnet-mask 255.255.255.0; option broadcast-address 192.168.0.255; option domain-name-servers 192.168.0.1; option domain-name "me.fr"; default-lease-time 600; max-lease-time 7200; range 192.168.0.2 192.168.0.62; } #wifi subnet 192.168.0.63 netmask 255.255.255.192 { option routers 192.168.0.1; option subnet-mask 255.255.255.0; option broadcast-address 192.168.0.255; option domain-name-servers 192.168.0.1; option domain-name "me.fr"; default-lease-time 600; max-lease-time 7200; range 192.168.0.66 192.168.0.126; } 

在/ etc /默认/ ISC-DHCP服务器

 INTERFACES="eth1 wlan0" 

/etc/hostapd/hostapd.conf

 interface=wlan0 ssid=HAL hw_mode=g wpa=2 wpa_passphrase=oderojafoda2u9k wpa_key_mgmt=WPA-PSK 

的/ etc /networking/接口

 # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo eth0 eth1 iface lo inet loopback # The primary network interface allow-hotplug eth0 iface eth0 inet dhcp allow-hotplug eth1 iface eth1 inet static address 192.168.0.1 netmask 255.255.255.0 iface wlan0 inet static address 192.168.0.65 netmask 255.255.255.0 

但DHCP服务器以这些错误开始:

 Mar 16 20:27:24 HAL dhcpd: Multiple interfaces match the same subnet: eth1 wlan0 Mar 16 20:27:24 HAL dhcpd: Multiple interfaces match the same shared network: eth1 wlan0 

但即使结果是“好”,服务器实际上是开始,它只会服务于我的第二个范围,任何想法我可以做错了?

ps:有一个我想要做的快速/简单的图表:

这里

谢谢

你定义了错误的networking掩码,这就是为什么DHCP服务器无法启动

 iface eth1 inet static address 192.168.0.1 netmask 255.255.255.0 iface wlan0 inet static address 192.168.0.65 netmask 255.255.255.0 

第二个networking的networking掩码应该是192。

您可以将参数接口添加到子网声明中,因此每个子网都是为单独的接口定义的:

 subnet 192.168.0.0 netmask 255.255.255.192 { interface eth0; <other staff> } subnet 192.168.0.63 netmask 255.255.255.192 { interface wlan0; <other staff> }