Wrong netmask for dhcpd ?
I always manage to ruin my netmask in dhcpd... 255.255.0.0 worked when the only wlan network I had was 10.0.0.0 (note that I always had the 192.168 network too, and it worked).
Code:
/etc/dhcpd.conf line 12: subnet 10.0.1.0 netmask 255.255.0.0: bad subnet number/mask combination. Code:
wlan0 Link encap:Ethernet HWaddr 00:12:17:0D:39:23 Code:
net 192.168.1.0 netmask 255.255.255.0 { |
Hi,
A netmask is (in binary) composed of 2 sets of bits. The first is made only of bits set to 1 The second is made only of bits set to 0 Bits set to 1 indicate what part of the IP address refers to the network address Bits set to 0 indicate what part of the IP address refers to the host address So this config : 10.0.1.34 255.255.0.0 (11111111.11111111.00000000.00000000) means that you're the host number 1.34 in the 10.0.0.0 network Thus in your conf there are 2 problems : 1/ IP config of interfaces : WLAN0 : inet addr:10.0.0.1 Bcast:10.255.255.255 Mask:255.0.0.0 WLAN0.1 : inet addr:10.0.1.1 Bcast:10.255.255.255 Mask:255.0.0.0 both interfaces are in the same subnet : 10.0.0.0 255.0.0.0 they should be in different subnets : 10.0.0.0 255.255.255.0 and 10.0.1.0 255.255.255.0 2/ DHCPD config : subnet 10.0.1.0 netmask 255.255.0.0 subnet 10.0.0.0 netmask 255.255.0.0 first that doesn't match your interfaces config (255.0.0.0) and second you've got 2 instances of the same subnet : 10.0.1.0 255.255.0.0 is included in 10.0.0.0 255.255.0.0 just like all 10.0.x.x addresses. so, as for the interfaces, you've got to use 255.255.255.0 netmask. I'm not sure whether I made myself clear... since the difference between your 2 subnets is in the 3rd byte of the address, the mask _MUST_ be 3 times 255 and then 0. Remark : the default mask for 10. networks is 255.0.0.0, and the default one for 192 networks is 255.255.255.0, that's why your interfaces are configured with these masks. But that's not a problem, you can use other masks, but, if so, then you have to specify the mask you'll use : ifconfig eth0 192.168.0.3 will give a 192.168.0.3 255.255.255.0 config ifconfig eth0 192.168.0.3 netmask 255.255.0.0 will overide the default mask and give a 192.168.0.3 255.255.0.0 config Good luck, |
As fr_laz mentioned on his post, change you netmask to a 24 bit mask (255.255.255.0) -or- another option would be to change your network address to use the second octet. i.e.
10.0.0.0 - 255.255.0.0 10.1.0.0 - 255.255.0.0 |
I've always had an issue with the binary netmask idea...I'll get it eventually hehe.
Thanks very much for both your replies; very clear! |
All times are GMT -5. The time now is 05:43 AM. |