Operating System - Linux
1752703 Members
5449 Online
108789 Solutions
New Discussion юеВ

multiple subnets multiple dhcp ranges

 
SOLVED
Go to solution
Matt Shaffer_1
Regular Advisor

multiple subnets multiple dhcp ranges

I need to add a 2nd dhcp range and it is in a different subnet. I've tried to edit /etc/dhcpd.conf and also adding through webmin. The 2nd range isn't working though. I'm sure I'm missing something but I can't find it anywhere.
4 REPLIES 4
Stuart Browne
Honored Contributor
Solution

Re: multiple subnets multiple dhcp ranges

Dumb comment first. The DHCP server has to have an interface in each subnet.

Now, I'm assuming you've got this already, so we'll look at the finer points of dhcpd configs. Here's a quick example of a multi-subnet dhcpd.conf:

ddns-update-style interim;
ignore client-updates;

subnet 10.1.1.0 netmask 255.255.255.0 {

# --- default gateway
option routers 10.1.1.254;
option subnet-mask 255.255.255.0;

option nis-domain "domain.com";
option domain-name "domain.com";
option domain-name-servers 10.1.1.254;

option time-offset -18000; # Eastern Standard Time
option ntp-servers 10.1.1.254;
option netbios-name-servers 10.1.1.254;

range dynamic-bootp 10.1.1.1 10.1.1.253;
default-lease-time 21600;
max-lease-time 43200;
}
subnet 192.168.1.0 netmask 255.255.255.0 {

option routers 192.168.1.254;
option subnet-mask 255.255.255.0;

option nis-domain "domain.com";
option domain-name "domain.com";
option domain-name-servers 192.168.1.254;

option time-offset -18000; # Eastern Standard Time
option ntp-servers 192.168.1.254;
option netbios-name-servers 192.168.1.254;

range dynamic-bootp 192.168.1.2 192.168.1.252;
default-lease-time 21600;
max-lease-time 43200;
}

Just to let you know, this is what I use at home. The .254 IP in each block is the local machine's IP address on that subnet.
One long-haired git at your service...
Stuart Browne
Honored Contributor

Re: multiple subnets multiple dhcp ranges

Actually, I misspoke.

You don't need an interface on the other subnet, you just need to be able to route to it.

Thus allowing you to DHCP-Relay from remote locations where you're nowhere near the subnet.
One long-haired git at your service...
Ivan Ferreira
Honored Contributor

Re: multiple subnets multiple dhcp ranges

If your DHCP server does not have an interface directly connected to the other subnet, you need a DHCP relay agent on that subnet.

Can you describe your network, an ASCII diagram could help.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Matt Shaffer_1
Regular Advisor

Re: multiple subnets multiple dhcp ranges

. Stuart's post helped a lot.