Setting up DHCP server behind two routers

dhcp-serverwindows-server-2003

I have a network configured in the following fashion:

                   |-> Imaging server (192.168.1.42)
                   |-> 192.168.1.100-150 range
Internet->Router A-+-> Router B-⊺-> DHCP Server (Windows Server 2003, 192.168.2.2)
                                |-> 192.168.2.151-200 range

Is it possible to configure the DHCP Server to give out IP addresses to both ranges? Would it need to be directly on the Router A network?

A few more details:
Routers A & B are both D-link routers with DHCP off. Router A (DI-624) connects via PPPOE to the internet, and has an internal IP address of 192.168.1.1. Router B (DI-604) is statically assigned 192.168.1.2 to connect to Router A, and has an internal IP address of 192.168.2.1.

I've tried forwarding port 68 on Router A (DHCP requests), and made sure all other DHCP services are off (Router A, Router B, imaging server). Eventually, I'd also like to be able to set up the imaging server (Ubuntu/Fog Project) to serve all computers on the network via PXE boot.

I've seen this question, but I'm unsure how to configure my router as a DHCP helper (possible with a bare-bones D-link router?), as the only DHCP related options seem to be turning the service off and on.

As an aside, is it necessary for that last number of the IP address to be discrete across both ranges?

Best Answer

You'll need a little more equipment to make this work. Forwarding port 68 doesn't help because DHCP requests use broadcast packets - which won't get forwarded outside of the local subnet. If you want devices connected to Router B to get a DHCP address from Router A, you'll need a DHCP Relay Agent. Neither of the D-Link models you list does this, but they're on Windows Server since 2003 (http://technet.microsoft.com/en-us/library/cc781416%28v=ws.10%29.aspx) and Linux (http://linuxcommand.org/man_pages/dhcrelay8.html).

This will give you a system where devices behind Router B get addresses from the same pool as Router A. You could give devices behind Router B their own subnet if you run dhcpd on the Ubuntu server and configure it properly.

As for the last question, if you've got one subnet that's 192.168.1.XXX and one that's 192.168.2.XXX, there's no problem with their last octet overlapping. 192.168.1.15 and 192.168.2.15 are distinct, and won't interfere with each other.

Edit: Looking back at your question, if you're going to be PXE-booting devices on this network, you're definitely going to need the imaging server to be the DHCP host - Router A doesn't support the right DHCP options to make PXE happen.

Related Topic