Re: Recommendations for Configuring DHCP on Multiple Interfaces
Roy Marples
Fri Jun 06 08:16:54 2014
Hi
Sorry for the late reply.
On 04/06/2014 22:35, David Hauck wrote:
I've been researching various techniques for using DHCP configured
interfaces in a multi-homed environment. Unfortunately, I haven't
uncovered any clear guidance on the various aspects of this with
DHCPCD. One particular question I have relates to all of the (DHCP)
interfaces communicating with the same DHCP server and being
subsequently served addressing information from a pool of addresses on
the same subnet (e.g., 192.168.2.[234]/24). This isn't problematic in
and of itself, but generally each exchange also includes any number
of: hostname, gateway, name server, ntp servers, static routes,
etcetera. I've seen some material that indicates interface-specific
DHCP configuration can be used to control which interfaces ignore
these duplicated, global settings and, correspondingly, which
interface might be configured to accept them (e.g., to ensure only one
negotiates the configuration for hostname, default gateway, name
servers, etc.).
I recognize that there might be some configurations where it *may* be
desirable to have, for e.g., multiple default gateways, but even this
is generally frowned upon (note that my current focus is IPv4).
However, I'd like to constrain possibilities like this in my
configurations.
What is the recommended way to do this under a Debian-based (sysvinit)
system? I saw a reference somewhere that mentioned using an
/etc/default/dhcpcd file to help with something like this, but I don't
think this is standard. I'm guessing there's something similar built
into DHCPCD (i.e., some way to configure interface-specific
parameters/environment variables), but I've not yet been able to
isolate this.
The recommended dhcpcd way is just to run dhcpcd and let it manage
things :)
Basically it will internally manage ip addressing and routing per
interface.
On Linux there will be multiple default gateways, but this is *fine*
because they are split out by routing metric (lowest wins).
In the typical multi-homed system (ie a laptop with ethernet and
wireless) dhcpcd will automatically prefer the wired host rather than
the wireless.
It should be a fairly seamless transition between the two as well
(unplug / plug the wired cable)
As to information duplication, well all of the hook scripts take this
into account.
So for resolv.conf and ntp{d}.conf it's all managed.
You may want to look into using resolvconf (I personally recommend
openresolv ;) ) as that can handle it better than dhcpcd.
Thanks
Roy
Archive administrator: postmaster@marples.name