-   Linux - Server (
-   -   setting up linux dhcp server with multiple scopes (

guy_ripper 07-09-2007 02:06 PM

setting up linux dhcp server with multiple scopes

Anyone here knows how to setup a linux dhcp server with multiple scopes? I have 3 different subnets in our network. 192.168.1.x, 192.168.2.x and 192.168.3.x. All my servers are in .1 subnets and one of them is a dhcp. Now, I want also that my .2 and .3 subnets will taken care of an one dhcp server which part of .1 subnet. I'm using a linux router to communicate with different subnets.

Thanks in advanced.

acid_kewpie 07-09-2007 02:10 PM

well you just add them, there's nothing stopping you doing this at all. just use a different subnet { } section for each one and off you go.

guy_ripper 07-09-2007 02:23 PM


Thanks for your reply. I need to clarify does it need three network cards for my dhcp server? Each nic is connected with each subnets respectively?

hazmatt20 07-09-2007 02:39 PM

It depends on your setup. Are the subnets physically separate? If so, you'd need to connect different nic cards to the different switches. If there are in the same physical network, then all you have to do is modify dhcpd.conf.

guy_ripper 07-09-2007 03:12 PM

Yes, @hatmatt... they are in separate LAN.

hazmatt20 07-09-2007 03:21 PM

Then you would need to install a separate nic for each subnet and statically assign them the address 192.168.x.1 for the respective network. Then you would define the subnets in dhcpd.conf.

If anyone has a more elegant solution, feel free to jump in, but that's the only way that I know.

farslayer 07-09-2007 03:52 PM

Or a single NIC is fine if the router supports a feature like ip-helper address (cisco) basically you are telling the router to relay DHCP requests to a SPECIFIC IP address that is the location of the DHCP server.

I had dual DHCP servers setup to handle 24 different subnets using this method. no problems.

Note there is a dhcp-relay package available for Linux as well if you are using Linux machines as routers.

If you are hosting multiple subnets in a large network you might also want to look at configuring DHCP fail-over in your DHCP servers, and then setup 2 machines as DHCP servers.

acid_kewpie 07-09-2007 03:53 PM

that's a real ugly way to do it, but it depends what the rest of the network does as to wether the best solutions are feasible. you *should* place a DHCP relay agent on each subnet, any server or pc can actually perform this function, but normally it's the router or firewall. this just accepts dhcp requests and directly forwards to an existing DHCP server like this one.

as for doing it without, you can use 802.1q trunking on a single nic to get the same result.

All times are GMT -5. The time now is 11:33 AM.