RE: Recommendations for Configuring DHCP on Multiple Interfaces
Roy Marples
Fri Jun 06 18:15:44 2014
On 06/06/2014 18:32, David Hauck wrote:
Actually, I admittedly haven't looked at "interface specific"
configurations in dhcpcd.conf before, but isn't this exactly what I
need here? Couldn't I do something like:
...
interface eth1
nogateway
nooption 12 # ignore hostname on this interface
Ah, you didn't mention it was ok to discard the other interfaces.
Yes, that should work fine.
nooption hostname # no need to specify 12 ;)
In a two-interface (eth[01]) DHCP setup this would allow eth0 to do
full DHCP negotiation and eth1 to ignore gateway and hostname. Do I
have this right?
Yes!
But Beware!
IF this interface is not configured (ie, link down) and another is
then dhcpcd will install a default interface for that interface and
gateway.
Do you mean "install default route"?
Yes I do, but as you indicated above it's fine to discard this
information.
What this means is that only eth0 can install a default route, and if
eth0 is "down" then no default route will be available.
When the interface is configured (ie, link up) then dhcpcd will change
the default route to the preferred interface and gateway.
I'm not following the specifics of this. Could you maybe provide a
concrete example?
Sure. Keeping with eth0 and eth1, eth0 has metric 0 and eth1 has metric
1.
Both interfaces request default routes, ie not your options above.
dhcpcd is compiled with route metrics disabled.
Order of events:
eth0 UP, install default route
eth1 UP, don't change default route as eth0 is UP
eth0 DOWN, remove default route, install default route from eth1
eth0 UP, remove default route, install default route from eth0
eth1 DOWN, no change to default route
Hope this clarifies the actions :)
Thanks
Roy
Archive administrator: postmaster@marples.name