Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 06-22-2010, 12:56 PM   #1
LQ Newbie
Registered: Jun 2004
Posts: 12

Rep: Reputation: 0
Gateway assignment and DHCP+DHRELAY Question

I am having some difficulties comprehending some networking concepts relating to multiple subnets and dhcp servers, or dhcp relay servers.

I have built home networks many times before, and they have all followed a very simple formula. A single subnet, let's say which is fairly typical for me. My network's DNS server is always also my networks DHCP server. Typically at When a DHCP client broadcasts for an IP over the subnet, DNS/DHCP server) will not only tell the client what it's new IP is to be, but will also tell the client what it's Gateway server is. This is ALSO for me typically.

In this manner, a client broadcasts for networking information and is given a usable IP, and told to use for most other functionality. Very simple. However, I am uncertain how to expand this to other subnets. Say..

A: I can use a separate DHCP server for each subnet.
B: I can use a DHCP Relay agent for to pass the DHCP requests to the primary DHCP server on the subnet.

Option A: is fairly straight forward and have had it functioning fine, but it is really B: I want to know more about. It seems somehow much cleaner to me. I prefer to centralize as much of my network provisioning services as possible. It makes it easier to manage TYPICALLY.

My question though is related to Gateways and the use of DHCP Relay Agents.

Given a network with the two subnets, Subnet-A: and Subnet-B: - each with it's own Gateway server to route the network traffic. Make these and respectively. Further, the DHCP Server is located on, while is a DHCP Relay Agent which passes requests from the subnet to for provisioning.

Now the question!!: How does one ensure that clients on the subnet are given the right gateway? That is... Client machines on should be given a Gateway of, NOT of

However I have no idea how to do this. The DHCP Server at is configured to tell clients is their gateway - this won't do for clients.

I am not particularly looking for exact instructions.. Just to have some of this networking fog cleared from my head. It really sounds like a very simple thing, but I have almost no practical experience in dealing with multiple subnets, and would just love to have this issue clarified a bit for me.

I have googled to quite some extent on the subject of DHCP servers, Relays and Gateway provisioning.. but have met with little success in increasing my understanding of this issue.

Please, someone with Network know how help explain this to me in very simple terms!

p.s. Again, please.. I thank anyone to take the time to help me, but no suggestions for the creation of a separate DHCP server for each subnet. DHCP Relays are what's confusing me.

- Lord_Devi
Old 07-12-2010, 04:29 PM   #2
Registered: Feb 2004
Location: UK
Distribution: RHEL/Fedora, Solaris 11, NetBSD, MacOS
Posts: 223

Rep: Reputation: 42

Normally the DHCP server that you are fowarding to would have a configuration so it knows what to do with clients on the network i.e. so it knows to give them an IP address in the 192.168.2.x range and the correct gateway etc. to assign to clients in this network range. Take a look at this documentation and see the section Options for DHCPd. You should just (no guarantees, it's been a while since I did this on a UNIX system!) need to add a config block for the range.

From what you've said, I guess this is home kit. Doesn't usually support relaying the dhcp requests from my experience. I've only ever done this part on things like Cisco/Extreme/FortiNet devices. It's possible to set up on linux gateway/router it seems, see dhcrelay.

Hope that gives you an idea of what's needed!



dhcp, gateway, relay

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
wrong dhcp assignment orielgalvez Linux - Newbie 2 02-02-2010 02:17 AM
IP assignment to authorized user only through DHCP server !!! arunabh_biswas Linux - Security 2 01-22-2010 12:04 AM
DHCP gateway question Fernandoch Debian 1 05-18-2006 05:13 AM
File Assignment Question JC404 Linux - Newbie 4 07-03-2003 08:15 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:25 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration