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

Notices

Reply
 
Search this Thread
Old 06-22-2010, 12:56 PM   #1
Lord_Devi
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 192.168.1.0 which is fairly typical for me. My network's DNS server is always also my networks DHCP server. Typically at 192.168.1.1. When a DHCP client broadcasts for an IP over the subnet, 192.168.1.1(My 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 192.168.1.1 for me typically.

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

A: I can use a separate DHCP server for each subnet.
or
B: I can use a DHCP Relay agent for 192.168.2.0 to pass the DHCP requests to the primary DHCP server on the 192.168.1.0 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: 192.168.1.0 and Subnet-B: 192.168.2.0 - each with it's own Gateway server to route the network traffic. Make these 192.168.1.1 and 192.168.2.1 respectively. Further, the DHCP Server is located on 192.168.1.1, while 192.168.2.1 is a DHCP Relay Agent which passes requests from the 192.168.2.0 subnet to 192.168.1.1 for provisioning.

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

However I have no idea how to do this. The DHCP Server at 192.168.1.1 is configured to tell clients 192.168.1.1 is their gateway - this won't do for 192.168.2.0 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
SteveK1979
Member
 
Registered: Feb 2004
Location: UK
Distribution: RHEL5/6, Solaris 10/11, NetBSD, OpenBSD, FreeBSD, MacOS
Posts: 221

Rep: Reputation: 40
Hi,

Normally the DHCP server that you are fowarding to would have a configuration so it knows what to do with clients on the 192.168.2.0 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 192.168.2.0 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!

Cheers,
Steve
 
  


Reply

Tags
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


All times are GMT -5. The time now is 08:38 AM.

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