Possible Duplicate:
Can I have multiple DHCP servers on one network?

This is a very old question i guess.In this forum itself it has been answered in Multiple VLANs, multiple subnets, single DHCP server?.That is done on using the Helper options of Cisco router. But in my case we are not using the Cisco router.

In my ubuntu machine i have set 3 VLANs with id's 3,4,5.I wanted to provide them with the IP addresses through dhcp server.But i have a doubt related to the concept as well as the implementation.Normally a dhcp server will be configured with one interface (say eth0 )with a particular IP address say of if a client requires IP, it will send dhcp requests to that server and the server also identifies that the request is from that subnetwork, and provides an appropriate IP from the same subnetwork.(say

But if many VLAN interfaces are there and requesting for IP address, how the Server will differentiate that the dhcp request is from this particular VLAN and provide the IP from the corresponding subnetwork range.

I heard that we should create the VLANs on the dhcp-server.Can anyone please throw some light on method, the concept as well as the implementation?

marked as duplicate by Mike Pennington, dunxd, Rob Moir, Ward, Shane Madden Jul 31 '12 at 4:01

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Is the ubuntu box the router for these subnets? Is the DHCP server on this ubuntu box? If not, what is acting as the router, and what is acting as the DHCP server? – Mike Pennington Jul 30 '12 at 14:53
  • The dhcp server and router are different.dhcp server is another ubuntu machine . – nachi Jul 30 '12 at 15:05
  • what is your router? Juniper? Something else that you tell us?? :-) – Mike Pennington Jul 30 '12 at 15:31

if your linux router has trunk interface to the switch with tagged vlans you can do it without problems.

first define each vlan in /etc/network/interfaces eg:

auto eth0.200
iface eth0.200 inet static

iface eth0.201 inet6 static

iface eth0.202 inet6 static

then tell dhcp daemon to listen on some/all of those subnets by editing /etc/default/isc-dhcp-server [or dhcpd] and changing variable INTERFACES to "eth0.200 eth0.201 eth0.202"

and adding separate subnets to /etc/dhcp/dhcpd.conf

subnet netmask {
  # you might point some other address 
  # within that subnet that should be advertised as router
  # it does not have to be your linux box
  option routers;
  option broadcast-address;

and so on for the rest of subnets.

  • hi pQd,Does it mean that the server will be listening on all the interfaces simultaneously? And do i need to create the VLANs again on the server to provide the virtual interfaces for the server to listen? If i do so,then the server will be having 3 virtual static address,is that so? My questions may be silly, but i wish to get clarified. thanks – nachi Jul 30 '12 at 15:14
  • yes - it'll listen on all 3 [in my example] vlans. you create virtual interfaces just by adding the lines to /etc/netwrok/interfaces.. and.. you'll need to apt-get install vlan – pQd Jul 30 '12 at 15:17

To create multiple VLAN on your server, you will need a switch with 802.1q (VLAN Tagging or Trunk in Cisco terminology) enable or multiple physical interface. The DHCP server will listen requests on each interface. You can define the distributed addresses for each interface.

The clients are connected on one VLAN, the broadcast the IP request. Your server receive the request and then answer to the range defined for this VLAN.

Do you have a switch with 802.1q support ? Or do you have multiple interfaces on your server ?

  • This is not the only case: I have an AP wired to an interface on my server which broadcasts two SSIDs, and packets from each of the SSIDs are tagged with a different VLAN. – WoJ Sep 10 '16 at 13:57
  • Of course but the question was about a router, so no Wifi. – Dom Sep 10 '16 at 18:29

If you router is a Linux box, then you need to install a DHCP relay. The most common is the ISC package isc-dhcp-relay.

Once you install it you must give it a list of every interface that it will be relaying DHCP to and from, and you must provide the IP address of the DHCP server. The config file is /etc/default/isc-dhcp-relay.

The name of the package has changed once in the last couple years, so if you are running an older version of Ubuntu the package might be named different.

Not the answer you're looking for? Browse other questions tagged or ask your own question.