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-09-2018, 02:16 PM   #1
detroitgeek
LQ Newbie
 
Registered: May 2008
Location: Detroit, MI
Distribution: ubuntu, slackware, debian
Posts: 4

Rep: Reputation: 0
DHCP Server multiple interfaces and subnets


I'm using Debian 8 and isc-dhcp-server.

my dhcpd.conf contains 2 subnets:

#wlan stuph
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.1 192.168.0.254;
}


# USB g_ether DHCP Service:
subnet 192.168.7.0 netmask 255.255.255.0 {
range 192.168.7.1 192.168.7.254;
}

DHCP is offered only on wlan and not USB when both are active, as above. But if I comment out wlan as below:

#wlan stuph
#subnet 192.168.0.0 netmask 255.255.255.0 {
# range 192.168.0.1 192.168.0.254;
#}


# USB g_ether DHCP Service:
subnet 192.168.7.0 netmask 255.255.255.0 {
range 192.168.7.1 192.168.7.254;
}

the USB port now offers DHCP (but not wlan of course).

the file /etc/default/isc-dhcp-server has:
INTERFACES=""
but I also tried:
INTERFACES="wlan1 usb0"

How do I get both ports to offer DHCP?

Last edited by detroitgeek; 05-09-2018 at 02:29 PM. Reason: added info about the /etc/default/isc-dhcp-server file
 
Old 05-10-2018, 10:23 AM   #2
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Have you double-checked that the interface names are really wlan1 and usb0? In Debian it is usually wlan0. Unless you had a previous WLAN interface on wlan0 and changed the hardware. What does /sbin/ifconfig show.

It seems that your configuration is correct, I can spot no errors. But that is no guarantee.

The "INTERFACES=" in /etc/ics-dhcp-server is mandatory. So it should contain the correct interface names.

Tail your /var/log/syslog to see DHCP requests and how they are answered. Try to increase logging verbosity: https://docs.menandmice.com/display/...+for+debugging

jlinkels
 
Old 05-10-2018, 11:43 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,710

Rep: Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899
Have you looked at the logs for errors?

How are the network adapters configured and is Network Manager running?

By the way you should not use the entire subnet i.e x.x.x.1-x.x.x.254 because that would include the address for the adapter itself which could cause a conflict.
 
Old 05-10-2018, 01:54 PM   #4
detroitgeek
LQ Newbie
 
Registered: May 2008
Location: Detroit, MI
Distribution: ubuntu, slackware, debian
Posts: 4

Original Poster
Rep: Reputation: 0
Thank you both for your replies.

ifconfig reports the following interfaces: br0, eth2, eth3, lo, usb0, and wlan1. Yes hardware changes do happen, I'm working with a SOM that gets moved to other carrier boards. That's why you're seeing the strange enumeration. I have a script that watches for these changes and the script modifies other scripts and configs that use those interfaces. Since I've started with this problem, the hardware has not changed, so the configs and scripts aren't changing at this point. And as I pointed out, the interfaces do indeed work - isc-dhcp-server only wants to talk to one interface at a time, which can't possibly be right.

syslog doesn't show any errors. I looked in dhcpd.conf and found the log file set at log-facility local7; and there was no /etc/syslog.conf, so I created one and put the line 'local7.debug /var/log/dhcpd' into it and rebooted. No /var/log/dhcpd ever gets created and still no entries in /var/log/syslog when I try pulling an address from a remote machine. And looking into "https://docs.menandmice.com/display/...+for+debugging" just confused the dickens out of me - I have no idea what to really put in there for my scenario.
 
Old 05-10-2018, 04:12 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,710

Rep: Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899
As a test I had a few VirtualBox VMs that I could test a dhcp server to see if I could get it working. I could not test a USB network adapter.

The network adapters were configured using NetworkManager with a static IP address 192.168.1.1/24 and 192.168.2.1/24. The basic dhcp.conf subnet declaration was :
Code:
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.7.200;
}
subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.100 192.168.2.200;
}
I did not test both networks at the same time but I configured a Mint guest for each network one at a time and the server/client worked as expected and the guest acquired the expected IP address. I used INTERFACES="eth0 eth1" in the /etc/default/isc-dhcp-server configuration file. Since debian 8 uses systemd the dhcp log messages can be viewed using journalctl -xe command.

The basics seem to work so it is a matter of how your system is configured unless I missed something...
 
Old 05-12-2018, 05:29 PM   #6
detroitgeek
LQ Newbie
 
Registered: May 2008
Location: Detroit, MI
Distribution: ubuntu, slackware, debian
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks again both of you, there was nothing wrong with this configuration. There *was* one of those self-healing scripts that was making a change in the configs after the daemon was loaded instead of before. So this one's totally my fault - as it usually is
 
  


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
Setting up a DHCP server with multiple network interfaces - Debian Srz0rz Linux - Networking 6 11-19-2016 02:28 PM
Setup ipv6 DHCP server for multiple subnets in Linux. Need help immediately!!!!! lance_11235813 Linux - Newbie 4 10-29-2013 03:08 PM
Single DHCP server to serve multiple subnets ImanVajdi Linux - Networking 7 01-05-2010 07:56 AM
Help with DHCP Failover server with multiple subnets Kolibri Linux - Server 0 05-04-2009 04:50 AM
DHCP server with multiple nics and subnets hawkpaul Linux - Networking 6 12-20-2001 07:32 AM

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

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