LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-23-2014, 03:45 PM   #1
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Dhcp server bad subnet combination


I've been working on setting up dhcp server on my laptop, but, after saving settings to dhcpd & restarting services I get the error message

PHP Code:
bad subnet number/mask combination
This is my first attempt at this.
Anyway my router
has a subnet of 10.0.0.1 with netmask set at 255.255.255.0 which I entered in my dhcpd.conf.
That's when I got the bad subnet message.
Should I be trying to create another or am I supposed to use the information from the router?
 
Old 05-23-2014, 04:13 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 7
Posts: 3,533

Rep: Reputation: 974Reputation: 974Reputation: 974Reputation: 974Reputation: 974Reputation: 974Reputation: 974Reputation: 974
For a mask of 255.255.255.0 you need the last digit of the subnet part to be 0. If the mask were 255.255.0.0 then last two digits need to be zero, and so on. So just change your declaration to

Code:
subnet 10.0.0.0 netmask 255.255.255.0 {
 
Old 05-23-2014, 04:19 PM   #3
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Original Poster
Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
I have tried that setup but it says the addresses aren't available.
 
Old 05-23-2014, 04:20 PM   #4
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Original Poster
Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Actually this is the error message

Quote:
[FAIL] Stopping ISC DHCP server: dhcpd failed!
[FAIL] Starting ISC DHCP server: dhcpd[....] check syslog for diagnostics. ... failed!
failed!
 
Old 05-23-2014, 04:27 PM   #5
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Original Poster
Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Here is syslog output
Quote:
May 23 14:19:16 perfectionplus2 dhcpd: No subnet declaration for eth0 (no IPv4 addresses).
May 23 14:19:16 perfectionplus2 dhcpd: ** Ignoring requests on eth0. If this is not what
May 23 14:19:16 perfectionplus2 dhcpd: you want, please write a subnet declaration
May 23 14:19:16 perfectionplus2 dhcpd: in your dhcpd.conf file for the network segment
May 23 14:19:16 perfectionplus2 dhcpd: to which interface eth0 is attached. **
May 23 14:19:16 perfectionplus2 dhcpd:
May 23 14:19:16 perfectionplus2 dhcpd:
May 23 14:19:16 perfectionplus2 dhcpd: Not configured to listen on any interfaces!
 
Old 05-23-2014, 05:35 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 21,234

Rep: Reputation: 3974Reputation: 3974Reputation: 3974Reputation: 3974Reputation: 3974Reputation: 3974Reputation: 3974Reputation: 3974Reputation: 3974Reputation: 3974Reputation: 3974
You need to add the following to your dhcp.conf
DHCPDARGS=eth0;

There might be other parameters that might be missing so seeing your dhcp.conf file would help. Are you going to disable your router's DHCP server?
 
Old 05-23-2014, 06:19 PM   #7
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Original Poster
Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Code:
cat /etc/default/isc-dhcp-server
# Defaults for isc-dhcp-server initscript
# sourced by /etc/init.d/isc-dhcp-server
# installed at /etc/default/isc-dhcp-server by the maintainer scripts

#
# This is a POSIX shell fragment
#

# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).
DHCPD_CONF=/etc/dhcp/dhcpd.conf

# Path to dhcpd's PID file (default: /var/run/dhcpd.pid).
#DHCPD_PID=/var/run/dhcpd.pid

# Additional options to start dhcpd with.
#	Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead
#OPTIONS=""

# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
#	Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="eth0"
or did you mean dhcpd.conf

Code:
 sudo cat /etc/dhcp/dhcpd.conf
#
# Sample configuration file for ISC dhcpd for Debian
#
#

# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-update-style none;

# option definitions common to all supported networks...
option domain-name "example.org";
option domain-name-servers ns1.example.org, ns2.example.org;

default-lease-time 600;
max-lease-time 7200;

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
#authoritative;

# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;

# No service will be given on this subnet, but declaring it helps the 
# DHCP server to understand the network topology.

#subnet 10.152.187.0 netmask 255.255.255.0 {
#}

# This is a very basic subnet declaration.

subnet 10.0.0.0 netmask 255.255.255.0 {
  range 10.0.0.2 10.0.0.30;
  option routers 10.0.0.1;
}

# This declaration allows BOOTP clients to get dynamic addresses,
# which we don't really recommend.

#subnet 10.254.239.32 netmask 255.255.255.224 {
#  range dynamic-bootp 10.254.239.40 10.254.239.60;
#  option broadcast-address 10.254.239.31;
#  option routers rtr-239-32-1.example.org;
#}

# A slightly different configuration for an internal subnet.
#subnet 10.5.5.0 netmask 255.255.255.224 {
#  range 10.5.5.26 10.5.5.30;
#  option domain-name-servers ns1.internal.example.org;
#  option domain-name "internal.example.org";
#  option routers 10.5.5.1;
#  option broadcast-address 10.5.5.31;
#  default-lease-time 600;
#  max-lease-time 7200;
#}

# Hosts which require special configuration options can be listed in
# host statements.   If no address is specified, the address will be
# allocated dynamically (if possible), but the host-specific information
# will still come from the host declaration.

#host passacaglia {
#  hardware ethernet 0:0:c0:5d:bd:95;
#  filename "vmunix.passacaglia";
#  server-name "toccata.fugue.com";
#}

# Fixed IP addresses can also be specified for hosts.   These addresses
# should not also be listed as being available for dynamic assignment.
# Hosts for which fixed IP addresses have been specified can boot using
# BOOTP or DHCP.   Hosts for which no fixed address is specified can only
# be booted with DHCP, unless there is an address range on the subnet
# to which a BOOTP client is connected which has the dynamic-bootp flag
# set.
host perfectionplus2 {
  hardware ethernet 00:0a:e4:fa:77:e3;
  fixed-address 10.0.0.10;
}

# You can declare a class of clients and then do address allocation
# based on that.   The example below shows a case where all clients
# in a certain class get addresses on the 10.17.224/24 subnet, and all
# other clients get addresses on the 10.0.29/24 subnet.

#class "foo" {
#  match if substring (option vendor-class-identifier, 0, 4) = "SUNW";
#}

#shared-network 224-29 {
#  subnet 10.17.224.0 netmask 255.255.255.0 {
#    option routers rtr-224.example.org;
#  }
#  subnet 10.0.29.0 netmask 255.255.255.0 {
#    option routers rtr-29.example.org;
#  }
#  pool {
#    allow members of "foo";
#    range 10.17.224.10 10.17.224.250;
#  }
#  pool {
#    deny members of "foo";
#    range 10.0.29.10 10.0.29.230;
#  }
 
Old 05-23-2014, 06:50 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 21,234

Rep: Reputation: 3974Reputation: 3974Reputation: 3974Reputation: 3974Reputation: 3974Reputation: 3974Reputation: 3974Reputation: 3974Reputation: 3974Reputation: 3974Reputation: 3974
I don't see anything obviously wrong with either file. Since INTERFACES="eth0" is defined I'm not sure why you are seeing the "Not configured to listen on any interfaces! " error.

Have you assigned a static IP address to the laptop's eth0?
 
Old 05-23-2014, 08:38 PM   #9
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Original Poster
Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Quote:
Originally Posted by michaelk View Post
I don't see anything obviously wrong with either file. Since INTERFACES="eth0" is defined I'm not sure why you are seeing the "Not configured to listen on any interfaces! " error.

Have you assigned a static IP address to the laptop's eth0?
No I didn't.
 
Old 05-23-2014, 10:17 PM   #10
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Original Poster
Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Now I can start dhcpd, & the machine is seen in my dmesg, but still no network
Btw I called myself doing static address not sure if it's right.

Code:
 sudo tail /var/log/syslog
May 23 20:11:40 perfectionplus2 NetworkManager[2018]: <info> (eth0): carrier now ON (device state 10)
May 23 20:11:40 perfectionplus2 kernel: [ 3434.652930] 8139too 0000:06:07.0: eth0: link up, 10Mbps, half-duplex, lpa 0x0000
May 23 20:12:05 perfectionplus2 NetworkManager[2018]: <info> (eth0): carrier now OFF (device state 10)
May 23 20:12:05 perfectionplus2 kernel: [ 3460.076584] 8139too 0000:06:07.0: eth0: link down
May 23 20:12:12 perfectionplus2 NetworkManager[2018]: <info> (eth0): carrier now ON (device state 10)
May 23 20:12:12 perfectionplus2 kernel: [ 3467.411161] 8139too 0000:06:07.0: eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
May 23 20:12:13 perfectionplus2 dhcpd: DHCPDISCOVER from 20:cf:30:43:58:a2 via eth0
May 23 20:12:13 perfectionplus2 dhcpd: DHCPOFFER on 10.0.0.3 to 20:cf:30:43:58:a2 (perfectionplus4) via eth0
May 23 20:12:14 perfectionplus2 dhcpd: DHCPREQUEST for 10.0.0.3 (10.0.0.30) from 20:cf:30:43:58:a2 (perfectionplus4) via eth0
May 23 20:12:14 perfectionplus2 dhcpd: DHCPACK on 10.0.0.3 to 20:cf:30:43:58:a2 (perfectionplus4) via eth0

Last edited by EDDY1; 05-23-2014 at 10:19 PM.
 
Old 05-24-2014, 12:27 AM   #11
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Original Poster
Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
I guess the
Quote:
bad subnet number/mask combination.
is solved, as I can start the dhcpd service. Although I can't get an ip address nor the internet on the machine. I can ping the host machine which is connected to ethernet cable.

@michaelk
I have not disabled dhcp in the main router because there are multiple machines on the network which aren't mine & will not be connected to dhp server. The dhcp server is only intended to be used for 1 of my machines that isn't near the router& don't have any intentions of running wires to it.
Anyways the dhcp-server is connected to the router via wireless & to the machine via ethernet.
All of the .conf files related to this venture, were backed-up as .conf.old so I can return everything back to the original state of installing isc-dhcp-server.
What info can I provide to get this ball rolling?
 
Old 05-24-2014, 06:09 AM   #12
michaelk
Moderator
 
Registered: Aug 2002
Posts: 21,234

Rep: Reputation: 3974Reputation: 3974Reputation: 3974Reputation: 3974Reputation: 3974Reputation: 3974Reputation: 3974Reputation: 3974Reputation: 3974Reputation: 3974Reputation: 3974
It looks like perfectionplus4 is being assigned an IP address. I assumed you assigned eth0 a static IP address.

Your net subnet on eth0 should be different then the router's. You also need to enable IP forwarding to be able to pass traffic between eth0 and wlan0.
 
Old 05-24-2014, 10:30 AM   #13
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Original Poster
Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Ok I will try that out
 
Old 05-24-2014, 01:50 PM   #14
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Original Poster
Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Quote:
Originally Posted by michaelk View Post
It looks like perfectionplus4 is being assigned an IP address. I assumed you assigned eth0 a static IP address.
Yes, I think I did. Hopefully it's right.
Code:
# 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
iface lo inet loopback

iface eth0 inet static
     address 10.0.0.5
     network 10.0.0.1
     netmask 255.255.255.0
     broadcast 10.0.0.255
     gateway 10.0.0.1
Quote:
Your net subnet on eth0 should be different then the router's.
How do you make the determination of which subnet to add?
Quote:
You also need to enable IP forwarding to be able to pass traffic between eth0 and wlan0.
This 1 I believe I will figure out.

Last edited by EDDY1; 05-24-2014 at 01:54 PM.
 
Old 05-24-2014, 03:02 PM   #15
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Original Poster
Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
This is where I got info for setting subnet for dhcpd
http://linuxinside.blogspot.com/2012...debian_17.html
 
  


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
bad subnet number/mask combination. Jan Tanjo Linux - Server 3 01-27-2013 09:20 PM
DHCP:bad subnet/mask combination mahdit Linux - Networking 2 01-07-2010 11:02 AM
DHCP: Bad subnet number/mask combination OliXNet Linux - Networking 4 01-07-2010 10:17 AM
dhcp - bad subnet/mask combination ecunningham Linux - Server 2 03-19-2009 08:19 AM
dhcpd server problem: bad subnet number/mask combination 144419855310001 Linux - Networking 2 09-13-2007 10:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:51 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
Open Source Consulting | Domain Registration