dhcpcd-discuss

Re: FreeBSD VNET jails and dhcpcd

Roy Marples

Tue Jun 30 13:55:40 2020

On 30/06/2020 13:08, Goran Mekić wrote:
On Tue, Jun 30, 2020 at 12:33:32PM +0100, Roy Marples wrote:
dhcpcd supports this config on NetBSD and Linux.
I've not really tested it that much in anger on other OS's.
It works by changing the subnet route to the preferred interface by metric
which you can set like so in dhcpcd.conf:

interface lagg0
      metric 1 # Most preferred interface

Or you can just get dhcpcd to only work on lagg0 at the top of dhcpcd.conf:
allowinterfaces lagg0

You could also just restrict it to lagg0 via the commandline:
dhcpcd lagg0

But using the config file is generally best.
Does this fix it for you?

Roy


That's the thing, it is running with "lagg0" as first argument. This is
output of "ps ax | grep dhc":

  795  -  SC     0:00.27 dhcpcd: lagg0 [ip4] [ip6] (dhcpcd)
  796  -  S      0:01.24 dhcpcd: [privileged actioneer] lagg0 [ip4] [ip6] (dhcpcd)
  797  -  IC     0:00.00 dhcpcd: [network proxy] lagg0 [ip4] [ip6] (dhcpcd)
  798  -  IC     0:00.00 dhcpcd: [control proxy] lagg0 [ip4] [ip6] (dhcpcd)
  801  -  IC     0:00.00 dhcpcd: [network proxy] fe80::f2de:f1ff:fe64:c22a (dhcpcd)
  803  -  IC     0:00.00 dhcpcd: [network proxy] fe80::2c95:4993:93d8:18e8 (dhcpcd)
  804  -  IC     0:00.00 dhcpcd: [BPF ARP] lagg0 192.168.111.14 (dhcpcd)
  861  -  IC     0:00.00 dhcpcd: [network proxy] 192.168.111.14 (dhcpcd)

  Of course, setting it in config file is a nice workaround.


That's not a bug, that's a feature :)
Because you restricted dhcpcd to lagg0 via the commandline, all subsequent commands need to be limited the same way

dhcpcd lagg0	# Start dhcpcd on lagg0
dhcpcd -n	# If dhcpcd is not started on all interfaces, start it or rebind

What you need to do is:
dhcpcd -n lagg0

Notice that `dhcpcd -x` will likewise fail, but `dhcpcd -x lagg0` will work.

This is why it's generally better to limit the interfaces in dhcpcd.conf to save any potential issues on the command line.
This behaviour is documented in dhcpcd(8) under the "Multiple interfaces" section.

Does this fix your issue?

Roy

Follow-Ups:
Re: FreeBSD VNET jails and dhcpcdGoran Mekić
References:
FreeBSD VNET jails and dhcpcdGoran Mekić
Re: FreeBSD VNET jails and dhcpcdRoy Marples
Re: FreeBSD VNET jails and dhcpcdGoran Mekić
Re: FreeBSD VNET jails and dhcpcdRoy Marples
Re: FreeBSD VNET jails and dhcpcdGoran Mekić
Archive administrator: postmaster@marples.name