LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 05-10-2005, 02:06 PM   #1
michaelsanford
Member
 
Registered: Feb 2005
Location: Ottawa/Montréal
Distribution: Slackware + Darwin (MacOS X)
Posts: 468

Rep: Reputation: 30
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.
subnet 10.0.1.0 netmask 255.255.0.0
                                  ^
Configuration file errors encountered -- exiting
Why isn't this ok ?
Code:
wlan0     Link encap:Ethernet  HWaddr 00:12:17:0D:39:23
          inet addr:10.0.0.1  Bcast:10.255.255.255  Mask:255.0.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:30739 errors:0 dropped:0 overruns:0 frame:0
          TX packets:181778 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:5090507 (4.8 Mb)  TX bytes:257826621 (245.8 Mb)
          Memory:f5001000-f50017ff

wlan0:1   Link encap:Ethernet  HWaddr 00:12:17:0D:39:23
          inet addr:10.0.1.1  Bcast:10.255.255.255  Mask:255.0.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Memory:f5001000-f50017ff
Code:
net 192.168.1.0 netmask 255.255.255.0 {
        option routers 192.168.1.1;
        option domain-name-servers 206.47.244.12, 206.47.244.42;
        option ip-forwarding on;
        range 192.168.1.100 192.168.1.254;
}

subnet 10.0.1.0 netmask 255.255.0.0 {
        option routers 10.0.1.1;
        option domain-name-servers 206.47.244.12, 206.47.244.42;
        option ip-forwarding on;
        range 10.0.1.2 10.0.1.255;
}

subnet 10.0.0.0 netmask 255.255.0.0 {
        option routers 10.0.0.1;
        option domain-name-servers 206.47.244.12, 206.47.244.42;
        option ip-forwarding on;
#       range 10.0.0.10 10.0.0.19;

        host michael {
                hardware ethernet 00:30:65:21:A9:E3;
                fixed-address 10.0.0.11;
        }
}
 
Old 05-11-2005, 08:01 AM   #2
fr_laz
Member
 
Registered: Jan 2005
Location: Cork Ireland
Distribution: Debian
Posts: 384

Rep: Reputation: 32
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,

Last edited by fr_laz; 05-11-2005 at 08:06 AM.
 
Old 05-11-2005, 08:16 AM   #3
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
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
 
Old 05-11-2005, 11:15 AM   #4
michaelsanford
Member
 
Registered: Feb 2005
Location: Ottawa/Montréal
Distribution: Slackware + Darwin (MacOS X)
Posts: 468

Original Poster
Rep: Reputation: 30
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!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dhcpd wrong ip lease? del_gr Linux - Newbie 6 10-24-2006 11:58 AM
dhcpd subnet declaration problems in dhcpd.conf vcrispo Linux - Networking 6 07-15-2005 11:32 AM
upgraded to mandrake 10.1, now no internet and wrong netmask joseph_k Linux - Networking 3 03-16-2005 03:00 PM
what's wrong with this dhcpd.conf? gsgleason Linux - Networking 4 10-26-2004 01:57 PM
DHCPD startup failure, mdk 9.2, dhcpd v3.0.1rc11 fuzzyworm Linux - Networking 1 02-14-2004 04:58 AM


All times are GMT -5. The time now is 07:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration