DHCP and 2 subnets

Simon Hobson dhcp1 at thehobsons.co.uk
Sun Apr 6 12:34:03 UTC 2008

Chris Arnold wrote:

>Using SLES10 SP1 and dhcp-server-3.0.3-23.33. We have 2 subnets:
>Dhcp-server is configured on 1 NIC. We have a juniper firewall that connects
>the 2 subnets.
>What we are trying to accomplish:
>DHCP to clients on both subnets via this 1 dhcp server, which is on
>DHCP is configured and working on the 192.168.124.x network but i can not
>figure out how to get dhcp to the 192.168.123.x network.

>I have tried both
>shared-subnet and shared-network in the dhcp.conf file but the log tells me
>that this config spans multiple networks and does not start.

You do NOT have a shared network.

>How do i
>configure dhcp for both of these networks?

On the server, you simply define both subnets<period>

The trick is that you need to configure your router (or actually ANY 
device on the 'remote' network (192.168.123.x)) as a DHCP Relay (or 
BOOTP Relay). Note that this is NOT the same as forwarding broadcasts 
which will NOT work.

How it works is that the relay agent on the remote network fills in 
the Gateway Interface Address (GIAddr) field of the packets broadcast 
by the client. It then forwards the modified packet to the DHCP 
server. The server sees that the GIAddr field is filled in and uses 
this to determine the subnet the client is attached to. The server 
send it's reply back to the relay agent which broadcasts it on the 
clients network.

>This config gives me a 192.168.124.x ip on a client that is on the
>192.168.123.x network (this client should get a 192.168.123 ip):

Sounds like you have configured the router to forward broadcasts - 
this will NOT work as explained above.

>option domain-name "domain-here";
>option domain-name-servers 192.168.123.x;
>option ntp-servers 192.168.123.x;
>ddns-update-style none;
>subnet netmask {
>option routers 192.168.124.x;
>default-lease-time 14400;
>max-lease-time 172800;
>subnet netmask {
>option routers 192.168.123.x;
>default-lease-time 14400;
>max-lease-time 172800;

More information about the dhcp-users mailing list