Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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
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!
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;
# }
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?
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?
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
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?
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.