LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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-21-2021, 10:51 AM   #1
pwright2b
LQ Newbie
 
Registered: May 2021
Posts: 4

Rep: Reputation: Disabled
Post Debian DHCP server for network not on internet.


I'm trying to set up a Debian 10 DHCP server. I've been trying to follow the instructions on a variety of pages. But all these setups assume/seem to require that there be a router that connects to the internet. I don't want that. There is a small network supporting some equipment that is all connected by ethernet and all have static IPs. I'm trying to add an ability to access the equipment wirelessly. So I have this little linux box (an EeePC actually) running Debian. And I have a Cisco WAP. All on the wired network. But logging into the WAP from a phone requiring a static IP is too difficult for the need. So I want the EeePC to provide DHCP service with a safe range of IPs.

Every configuration I try fails, mostly complaining about not having an internet router (I think).

I've tried variations on most of the instructions I have found, so I suspect my configuration files are a mishmash. I'm including what I hope might help understanding my situation.

The mini-network I want to be able to join by wifi is this:

192.168.10.10 0C-4D-E9-C0-E1-1A EFFORTSTMAC-2
192.163.10.29 D3-67-D9-C3-5E-24 Cisco WAP
192.163.10.50 7C-2E-0D-09-CD-51 Blackmagic
192.163.10.55 00-22-15-F2-BC-45 EeePC HUB
192.168.10.240 7C-2E-0D-09-93-F4 ATEM

The EeePC is running Debian 10, a couple of programs from here (https://wifi-tally.github.io/) [which seem to be working fine], and isc-dhcp-server (which does not seem to be working fine).

---------------------

My dhcpd.conf file looks like this:
# dhcpd.conf
ddns-update-style none;
authoritative;
subnet 192.168.10.0 netmask 255.255.255.0 {
range 192.168.10.100 192.168.10.200;
option domain-name-servers 192.168.10.55;
option domain-name "localdomain";
option routers 92.168.10.55;
option broadcast-address 192.168.10.255;
default-lease-time 600;
max-lease-time 7200;
}

-----------------------------

my interfaces file looks like this:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug enp1s0
iface enp1s0 inet static
address 192.168.10.55
netmask 255.255.255.0
# This is an autoconfigured IPv6 interface
iface enp1s0 inet6 auto

-----------------------------------

When I do a dhcp server start, the systemctl status report looks like this:
root@debian:/home/user# systemctl status isc-dhcp-server.service
? isc-dhcp-server.service - LSB: DHCP server
Loaded: loaded (/etc/init.d/isc-dhcp-server; generated)
Active: failed (Result: exit-code) since Fri 2021-05-21 06:57:10 EDT; 1min 2s ago
Docs: man:systemd-sysv-generator(8)
Process: 3711 ExecStart=/etc/init.d/isc-dhcp-server start (code=exited, status=1/FAILURE)

May 21 06:57:08 debian dhcpd[3724]: bugs on either our web page at www.isc.org or in the README file
May 21 06:57:08 debian dhcpd[3724]: before submitting a bug. These pages explain the proper
May 21 06:57:08 debian dhcpd[3724]: process and the information we find helpful for debugging.
May 21 06:57:08 debian dhcpd[3724]:
May 21 06:57:08 debian dhcpd[3724]: exiting.
May 21 06:57:10 debian isc-dhcp-server[3711]: Starting ISC DHCPv4 server: dhcpdcheck syslog for diagnos
May 21 06:57:10 debian isc-dhcp-server[3711]: failed!
May 21 06:57:10 debian systemd[1]: isc-dhcp-server.service: Control process exited, code=exited, status
May 21 06:57:10 debian systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.
May 21 06:57:10 debian systemd[1]: Failed to start LSB: DHCP server.

--------------------------------------

And the journalctl -xe report looks like this:
root@debian:/home/user# systemctl start isc-dhcp-server
Job for isc-dhcp-server.service failed because the control process exited with error code.
See "systemctl status isc-dhcp-server.service" and "journalctl -xe" for details.
root@debian:/home/user# systemctl status isc-dhcp-server.service
? isc-dhcp-server.service - LSB: DHCP server
Loaded: loaded (/etc/init.d/isc-dhcp-server; generated)
Active: failed (Result: exit-code) since Fri 2021-05-21 11:01:12 EDT; 3min 31s ago
Docs: man:systemd-sysv-generator(8)
Process: 4821 ExecStart=/etc/init.d/isc-dhcp-server start (code=exited, status=1/FAILURE)

May 21 11:01:10 debian dhcpd[4834]: bugs on either our web page at www.isc.org or in the README file
May 21 11:01:10 debian dhcpd[4834]: before submitting a bug. These pages explain the proper
May 21 11:01:10 debian dhcpd[4834]: process and the information we find helpful for debugging.
May 21 11:01:10 debian dhcpd[4834]:
May 21 11:01:10 debian dhcpd[4834]: exiting.
May 21 11:01:12 debian isc-dhcp-server[4821]: Starting ISC DHCPv4 server: dhcpdcheck syslog for diagnos
May 21 11:01:12 debian isc-dhcp-server[4821]: failed!
May 21 11:01:12 debian systemd[1]: isc-dhcp-server.service: Control process exited, code=exited, status
May 21 11:01:12 debian systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.
May 21 11:01:12 debian systemd[1]: Failed to start LSB: DHCP server.
lines 1-16/16 (END)

--------------------------
-- Subject: A start job for unit isc-dhcp-server.service has begun execution
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit isc-dhcp-server.service has begun execution.
--
-- The job identifier is 3310.
May 21 11:01:10 debian isc-dhcp-server[4821]: Launching IPv4 server only.
May 21 11:01:10 debian dhcpd[4834]: Wrote 0 leases to leases file.
May 21 11:01:10 debian dhcpd[4834]:
May 21 11:01:10 debian dhcpd[4834]: No subnet declaration for enpls0 (no IPv4 addresses).
May 21 11:01:10 debian dhcpd[4834]: ** Ignoring requests on enpls0. If this is not what
May 21 11:01:10 debian dhcpd[4834]: you want, please write a subnet declaration
May 21 11:01:10 debian dhcpd[4834]: in your dhcpd.conf file for the network segment
May 21 11:01:10 debian dhcpd[4834]: to which interface enpls0 is attached. **
May 21 11:01:10 debian dhcpd[4834]:
May 21 11:01:10 debian dhcpd[4834]:
May 21 11:01:10 debian dhcpd[4834]: Not configured to listen on any interfaces!
May 21 11:01:10 debian dhcpd[4834]:
May 21 11:01:10 debian dhcpd[4834]: If you think you have received this message due to a bug rather
May 21 11:01:10 debian dhcpd[4834]: than a configuration issue please read the section on submitting
May 21 11:01:10 debian dhcpd[4834]: bugs on either our web page at www.isc.org or in the README file
May 21 11:01:10 debian dhcpd[4834]: before submitting a bug. These pages explain the proper
May 21 11:01:10 debian dhcpd[4834]: process and the information we find helpful for debugging.
May 21 11:01:10 debian dhcpd[4834]:
May 21 11:01:10 debian dhcpd[4834]: exiting.
May 21 11:01:12 debian isc-dhcp-server[4821]: Starting ISC DHCPv4 server: dhcpdcheck syslog for diagnos
May 21 11:01:12 debian isc-dhcp-server[4821]: failed!
May 21 11:01:12 debian systemd[1]: isc-dhcp-server.service: Control process exited, code=exited, status
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- An ExecStart= process belonging to unit isc-dhcp-server.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.
May 21 11:01:12 debian systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit isc-dhcp-server.service has entered the 'failed' state with result 'exit-code'.
May 21 11:01:12 debian systemd[1]: Failed to start LSB: DHCP server.
-- Subject: A start job for unit isc-dhcp-server.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit isc-dhcp-server.service has finished with a failure.
--
-- The job identifier is 3310 and the job result is failed.
lines 1413-1440/1440 (END)
-------------------------

Finally, a wild card. While thrashing around with all this I read the configuration file for Connman. It mentions that if I enabled and then started tethering for ethernet, it would start a DHCP server. Would that have solved my problem all along?

Thanks for any help.

-----Paul-----
 
Old 05-21-2021, 06:27 PM   #2
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
Quote:
option routers 92.168.10.55;
Is that line right? Looks like a typo for 192.168.10.55

FWIW, my own dhcpd.conf looks a bit like this (I removed all comments and some irrelevant stuff):

Code:
option domain-name-servers 192.168.1.1;
default-lease-time 600;
max-lease-time 7200;
ddns-update-style none;
authoritative;
subnet 192.168.1.0 netmask 255.255.255.0 {
  range dynamic-bootp 192.168.1.150 192.168.1.253;
  option routers 192.168.1.1;
  option domain-name-servers 192.168.1.1;
}
host tiana {
  hardware ethernet 00:01:29:59:13:05;
  fixed-address 192.168.1.109;
}
Now, this Debian system is indeed being used as a router, and I have routing to the outside internet all set up with iptables, but let's ignore that for now.

I suspect the relevant difference is here, in my /etc/network/interfaces

Code:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

auto enp4s0
iface enp4s0 inet dhcp

auto enp0s25
iface enp0s25 inet static
address 192.168.1.1
netmask 255.255.255.0
See how I have enp0s25 set to "auto" instead of "allow-hotplug"?

Give that a try. Alter your interfaces from "allow-hotplug" to "auto"

If that works, what I think is going on is that "allow-hotplug" maybe delays when the interface is actually brought up. But "auto" perhaps makes it try to bring up the interface first, and so by the time isc-dhcp-server is trying to do stuff, the interface is up?

I dunno, maybe I'm way off base. All I know is that it took me a while to tweak everything up and running, and getting it just the way I wanted.
 
Old 05-21-2021, 07:11 PM   #3
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
The problem is
Code:
No subnet declaration for enpls0 (no IPv4 addresses).
Your subnet declaration is for 192.168.10.0/24. The interface you configure in /etc/network/interfaces is enp1s0, which is not the same as enpls0. Can you post the output of ip a?
 
Old 05-21-2021, 07:33 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,727

Rep: Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919
Quote:
Not configured to listen on any interfaces!
What is your LAN ethernet adapter device ID enpls0 or enp0s25?

Edit your /etc/default/isc-dhcp-server file like:
INTERFACESv4="enpls0"

Try starting the DHCP server again.

Last edited by michaelk; 05-21-2021 at 07:36 PM.
 
Old 05-21-2021, 09:21 PM   #5
pwright2b
LQ Newbie
 
Registered: May 2021
Posts: 4

Original Poster
Rep: Reputation: Disabled
IsaacKuo; Good catch on the router 92. Definitely a typo. And I made the change from Allow-Hotplug to Auto. Not tested yet.

berndbausch: I struggled with enp1s0 and enpls0 but as far as I can tell it is a one not an ell. Here is ip a:

user@debian:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp1s0: <NO-CARRIER,BROADCAST,MULTICAST,DYNAMIC,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
link/ether 00:22:15:f2:bc:45 brd ff:ff:ff:ff:ff:ff

michaelk: As mentioned above, asbestos I can tell it is enp1s0. But apparently I had enpLs0 in the interfaces file. Corrected.

-----Paul------
 
Old 05-21-2021, 09:32 PM   #6
pwright2b
LQ Newbie
 
Registered: May 2021
Posts: 4

Original Poster
Rep: Reputation: Disabled
But, after all that, I get this:

user@debian:~$ sudo systemctl restart isc-dhcp-server
[sudo] password for user:
Job for isc-dhcp-server.service failed because the control process exited with error code.
See "systemctl status isc-dhcp-server.service" and "journalctl -xe" for details.
user@debian:~$ systemctl status isc-dhcp-server.service
? isc-dhcp-server.service - LSB: DHCP server
Loaded: loaded (/etc/init.d/isc-dhcp-server; generated)
Active: failed (Result: exit-code) since Fri 2021-05-21 22:25:08 EDT; 56s ago
Docs: man:systemd-sysv-generator(8)
Process: 1168 ExecStart=/etc/init.d/isc-dhcp-server start (code=exited, status=1/FAILURE)
user@debian:~$ journalctl -xe
Hint: You are currently not seeing messages from other users and the system.
Users in the 'systemd-journal' group can see all messages. Pass -q to
turn off this notice.
No journal files were opened due to insufficient permissions.
user@debian:~$ sudo journalctl -xe
May 21 22:25:06 debian dhcpd[1181]: exiting.
May 21 22:25:08 debian isc-dhcp-server[1168]: Starting ISC DHCPv4 server: dhcpdcheck syslog for diagnos
May 21 22:25:08 debian isc-dhcp-server[1168]: failed!
May 21 22:25:08 debian systemd[1]: isc-dhcp-server.service: Control process exited, code=exited, status
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- An ExecStart= process belonging to unit isc-dhcp-server.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.
May 21 22:25:08 debian systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit isc-dhcp-server.service has entered the 'failed' state with result 'exit-code'.
May 21 22:25:08 debian systemd[1]: Failed to start LSB: DHCP server.
-- Subject: A start job for unit isc-dhcp-server.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit isc-dhcp-server.service has finished with a failure.
--
-- The job identifier is 962 and the job result is failed.
May 21 22:25:08 debian sudo[1165]: pam_unix(sudo:session): session closed for user root
May 21 22:27:03 debian sudo[1190]: user : TTY=pts/0 ; PWD=/home/user ; USER=root ; COMMAND=/usr/bin
May 21 22:27:03 debian sudo[1190]: pam_unix(sudo:session): session opened for user root by (uid=0)
lines 2856-2883/2883 (END)


-----Paul-----
 
Old 05-21-2021, 09:48 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,727

Rep: Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919
Check the log files for error messages. /var/log/syslog
 
Old 05-21-2021, 11:28 PM   #8
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
One thing I'll note is that for a long time whenever I tried to start or restart isc-dhcp-server, it would say it failed because it exited with an error code ... but it was actually working perfectly fine. I never bothered to troubleshoot it further. Then at some point the error code thing went away. I don't remember what else was going on update-wise or whatever.
 
Old 05-22-2021, 02:21 AM   #9
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by pwright2b View Post
2: enp1s0: <NO-CARRIER,BROADCAST,MULTICAST,DYNAMIC,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
link/ether 00:22:15:f2:bc:45 brd ff:ff:ff:ff:ff:ff
This interface has no IP address and is down. As a result, subnet 192.168.10.0/24 configured in dhcpd.conf does not correspond to any NIC, and the DHCP server gives up.
 
Old 05-24-2021, 06:44 PM   #10
pwright2b
LQ Newbie
 
Registered: May 2021
Posts: 4

Original Poster
Rep: Reputation: Disabled
BTW, I finally gave up on the DHCP configuration, switched to an Access Point that had a built in DHCP server. It still doesn't like not having an internet connection but the network seems to be running. I appreciate your trying to help.

-----Paul-----
 
Old 05-25-2021, 12:00 AM   #11
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
I think you actually had it working, probably. Like I said, even if it claims it "failed" because it exited with an error code, it could have been working just fine.
 
  


Reply



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
Two DHCP ranges in one DHCP server using one NIC on a MPLS network - centos6 6.3 x64 pablobhz Linux - Newbie 7 03-04-2013 04:22 PM
Linux DHCP client unsuccessful on a windows DHCP served network tom1080 Linux - Newbie 1 12-16-2009 11:37 AM
Problem on acquiring IP addr. on client from dhcp server through dhcp relay server haariseshu Linux - Server 5 08-10-2009 01:20 AM
Instead of Router DHCP Server, Pass DHCP Server control to Slackware orbit Slackware 6 05-11-2009 02:00 AM
dhcp client not getting IP from dhcp server jkmartha Linux - Networking 2 06-17-2005 08:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:48 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