subnet error

Simon Hobson dhcp1 at thehobsons.co.uk
Wed Feb 28 21:26:31 UTC 2007


Mickael Choisnard wrote:

>I use a dhcp-client to get ip.
>When i add subnet 62.35.125.14 netmask 255.255.255.0 { not authorative; }
>I have this error :
>Feb 28 21:26:26 titi dhcpd: /etc/dhcp/dhcpd.conf line 4: subnet 62.147.195.246
>netmask 255.255.255.0: bad subnet number/mask combination.
>Feb 28 21:26:26 titi dhcpd: subnet 62.35.125.14 netmask 255.255.255.0

That's because 62.147.195.246 and 62.35.125.14 are not NETWORK 
numbers. Subnet mask 255.255.255.0 means a mask with 24 '1's and 8 
'0's (11111111 11111111 11111111 00000000). If you logical AND this 
with the network number, you should get the same value - but in your 
case this is not so.

62.147.195.246 ANDed with 255.255.255.0 gives 62.147.195.0. The 
network number is 62.147.195.0, the broadcast address is 
62.147.195.255, and hosts can have addresses from 62.147.195.1 to 
62.147.195.254.


You might find http://en.wikipedia.org/wiki/Subnet_mask useful


More information about the dhcp-users mailing list