LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 12-31-2007, 05:47 PM   #1
pridefc
Member
 
Registered: Nov 2005
Distribution: redhat, debian, ubuntu
Posts: 47

Rep: Reputation: 15
1 DHCP server needs to serve multiple VLANs


Hello,

Our current setup has 1 DHCP server with 1 NIC and is servicing 1 network.
Our dhcp.conf file has one single scope with the same default gateway.
The networking department is going to redo our network and create 4 VLANs and each with its own default gateway.

The DHCP port will be opened to all VLANs on the DHCP server.
We're going to create a scope for each VLAN so there will be 4 scopes.
I'm not sure how DHCP is going to work with this new network. ex) how would a client from 172.10.30.0 VLAN know to grab an IP from the 172.10.30.100-172.10.30.200 pool and not from the other scopes like 172.10.10.100-172.10.10.200 or 172.10.20.100-172.10.20.200?
I think the router has an ip helper-address function.

Thanks.

Current:
network: 1) 172.10.10.0/24
default gateway: 172.10.10.1
scope: 172.10.10.10-172.10.10.254
mask: 255.255.255.0


New network:
vlans: 172.10.10.0/24, 172.10.20.0/24, 172.10.30.0/24, 172.10.40.0/24
each with its own default gateway.

DHCP SCOPE:
scope: 172.10.10.100-172.10.10.200
mask: 255.255.255.0
default gateway: 172.10.10.1

scope: 172.10.20.100-172.10.20.200
mask: 255.255.255.0
default gateway: 172.10.20.1

scope: 172.10.30.100-172.10.30.200
mask: 255.255.255.0
default gateway: 172.10.30.1

scope: 172.10.40.100-172.10.40.200
mask: 255.255.255.0
default gateway: 172.10.40.1
 
Old 12-31-2007, 06:39 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
By VLAN, do you mean a subnet at the same site or do you have different sites connected via a encrypted VNC tunnels. If the latter, I don't think the dhcp signals are routable and you will be better off having one of your servers on each subnet function as a DHCP server.

If the former, do you have a host that routes traffic between the three subnet? If so, this would be the logical host to have a dhcp server.

If you don't have a host connected to each subnet, this article might help:
http://tcpmag.com/qanda/article.asp?EditorialsID=285

Last edited by jschiwal; 12-31-2007 at 06:40 PM.
 
Old 01-01-2008, 06:07 AM   #3
centauricw
Member
 
Registered: Dec 2005
Location: Lawrenceville GA
Distribution: Slackware, CentOS. Red Hat Enterprise Linux
Posts: 216

Rep: Reputation: 31
Quote:
I don't think the dhcp signals are routable ...
DHCP requests are not routable. The whole concept behind DHCP is that the client does not know it's IP address or anything about the makeup of the IP subnet, so it starts out by sending a DHCP request on the global broadcast address. If the DHCP server is behind a router from the client, the router has to be able to forward the DHCP request and proxy the DHCP communication between the server and the client.
 
Old 01-01-2008, 07:35 AM   #4
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
Quote:
The DHCP port will be opened to all VLANs on the DHCP server.
We're going to create a scope for each VLAN so there will be 4 scopes.
I'm not sure how DHCP is going to work with this new network. ex) how would a client from 172.10.30.0 VLAN know to grab an IP from the 172.10.30.100-172.10.30.200 pool and not from the other scopes like 172.10.10.100-172.10.10.200 or 172.10.20.100-172.10.20.200?

I think the router has an ip helper-address function.
A router or layer 3 switch that is configured with the "ip helper-address" command will resend the DHCP client request with the source address from the vlan/network that it was received to the assigned DHCP server(s). So a single DHCP server with multiple scopes defined and a single NIC knows which address pool (scope) to pull an address from so that it can send the proper DHCP reply back to the client. FWIW: We use the "ip helper-address" feature. Works great! Just create your scopes as you defined in your post.
 
Old 01-07-2008, 11:34 AM   #5
pridefc
Member
 
Registered: Nov 2005
Distribution: redhat, debian, ubuntu
Posts: 47

Original Poster
Rep: Reputation: 15
Thank you all!
 
Old 03-18-2010, 02:29 AM   #6
hafeezisbad
Member
 
Registered: Nov 2007
Posts: 32

Rep: Reputation: 0
by hafeezisbad@gmail.com

A working configuration example from hafeezisbad@gmail.com

Server ip : 172.27.0.10
Swtich ip / gateway ip of server : 172.27.0.100
Option domain –name servers : 172.27.0.6

Please note default vlan 172.27.0.x in this case

Switch and server need to be in default lan for communication / or else we need to trunk in case other vlan connected , we need to configure vconfig on server to communicate


For biggner I would recommend to go for the default vlan connectivity


Example :

ddns-update-style interim;
ignore client-updates;
default-lease-time 43200;
max-lease-time 43200;
authoritative;


#-----subnet mask-- broadcast-- gateway-#

option subnet-mask 255.255.255.0;
#option broadcast-address 192.168.1.1;
option routers 172.27.0.100;
option domain-name-servers 172.27.0.6;


# ----------- Server Scope and vlan1 with switches and server--------------#
subnet 172.27.0.0 netmask 255.255.255.0 {
#range 172.27.0.0 172.27.0.50;
option routers 172.27.0.1;
#option subnet-mask 255.255.255.0;
option broadcast-address 172.27.0.255;
#option domain-name-servers 172.27.0.5;
}


# ----------- clients1 Scope-vlan2-------------#
subnet 172.27.1.0 netmask 255.255.255.0 {
range 172.27.1.3 172.27.1.200;
option routers 172.27.1.1;
option subnet-mask 255.255.255.0;
option broadcast-address 172.27.1.255;
#option domain-name-servers 192.168.1.1 #
}


Save the file

Chkconfig –list dhcpd on
{ For enabling the service on all run levels }
Service dhcpd start
In case , dhcp server faild to start , check with log messages

/var/log/messages

Check for the ip helper address in layer 3 swtich , which act as dhcp-relay
Which has to be configured as 172.27.0.10


Troubleshooting Dhcp server start up error :

1) Run the Dhcp service in debug mode
2) Check the ip configuration
3) Check for syntax errors in dhcpd.conf file
4) Check for the right location of the dhcpd file
5) Ping test between the switch and server
6) Possible conflict of other dhcp server may be the issue

dhcpd in the foreground in debug mode with /usr/sbin/dhcpd -d –f

Hopefully, a DHCP server like the one we’ll be configuring will respond. Running tcpdump shows a dhcp request looks like:
17:26:02.003956 00:00:00:00:00:00 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0×0800), length 342: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request, length 300
You should notice DHCP running in the process (ps) list. Any problems, check syslog

Congratulations you have finally configured In easy steps
 
Old 03-18-2010, 11:32 AM   #7
deadeyes
Member
 
Registered: Aug 2006
Posts: 609

Rep: Reputation: 79
Just as a quick remark.
dhcp requests can be relayed. I use this with our firewalls.
However I don't know if linux can do this (probably it can).

You should have a virtual interface with an ip in each lan to accomplish what you want.
After that you can by specifying the IP on the virtual interface as broadcast address, have another range for each vlan.
 
  


Reply


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
NAT & DHCP with VLANs need help M_bassem Linux - Networking 2 07-15-2007 06:43 AM
Linux - multiple VLANS on eth0 john.morris Linux - Networking 3 12-10-2005 07:08 PM
how to serve dhcp ruwach Linux - Software 2 12-11-2004 01:59 AM
Connect static and dynamic DHCP with VLANs FatMike Linux - Software 0 11-12-2003 07:08 AM
DHCP, VLANs and Linux cestor Linux - Networking 5 06-02-2002 03:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:46 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration