One DHCP server, two VLANs?

Simon Hobson dhcp1 at thehobsons.co.uk
Tue Jan 12 21:04:21 UTC 2016


Karl Denninger <karl at denninger.net> wrote:

> This seems like it should be possible without a lot of hand-wringing, but I can't find the magic smoke recipe for it....  :-)

It is simple - you're just over thinking it !

> Topology is ...

> The DHCP server is on both VLANs via virtual interfaces (FreeBSD) with the port on the switch being told to send both through; it sees and handles traffic from both VLANs just fine.
> 
> But.... I cannot start two instances of dhcpd (one on each sub-interface.)  Nor can I find a way to tell dhcpd to read requests from both.

You just start one instance, but in that instance you define both subnets. So say your subnets are 192.168.1.0/24 and 192.168.2.0/24, then you need a config file a bit like this :

subnet 192.168.1.0 ...
  router ...
  ...
}
subnet 192.168.2.0 ...
  router ...
  ...
}

Then make sure that it listens on both interfaces. The default is to listen on all broadcast capable interfaces, but distribution specific startup scripts may read settings from a file and limit that.

In operation, the daemon tracks the packets and the interface they arrive through - from this is knows which subnet any request is for, and the rest happens automagically.



More information about the dhcp-users mailing list