dhcpcd-discuss

Re: FreeBSD VNET jails and dhcpcd

Roy Marples

Tue Jun 30 12:33:34 2020

On 30/06/2020 12:26, Goran Mekić wrote:
On Tue, Jun 30, 2020 at 11:41:03AM +0100, Roy Marples wrote:
dhcpcd -n will normally send SIGHUP to the process specified in /var/run/dhcpcd/pid

Just to be clear, SIGHUP does not mean restart, it means reload config and
rebind - so any current DHCP/RA/DHCPv6 is kept, it's just refreshed outside
the normal timers.

If I understand jails correctly, each jailed instance has it's own /var/run?
If so, I don't understand what issue you're seeing unless the jailed
interface also exists in the host? If so, what's the output of ifconfig so
we can try to exclude them?

Roy


I had to check as what you say is true even on the machine that acts
weird. So, I found out what's going on, and why it seamed like jail
dhcpcd was reloaded. I have lagg0 interface on which dhcpcd is running.
Members of that lagg0 are em0 and wlan0. The requirement is that only
lagg0 has dhcp client, but when I run dhcpcd -n, all three have the same
IP: em0, wlan0 and lagg0. I guess that's too confusing for FreeBSD. :o)

The output of ifconfig em0 / wlan0 / lagg0:

em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=88<VLAN_MTU,VLAN_HWCSUM>
	ether f0:de:f1:64:c2:2a
	inet6 fe80::f2de:f1ff:fe64:c22a%em0 prefixlen 64 scopeid 0x1
	inet6 fe80::2c95:4993:93d8:18e8%em0 prefixlen 64 scopeid 0x1
	inet 192.168.111.14 netmask 0xffffff00 broadcast 192.168.111.255
	media: Ethernet autoselect (1000baseT <full-duplex>)
	status: active
	nd6 options=1<PERFORMNUD>

wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	ether f0:de:f1:64:c2:2a
	hwaddr a0:88:b4:4e:b4:f4
	inet6 fe80::f2de:f1ff:fe64:c22a%wlan0 prefixlen 64 scopeid 0x3
	inet6 fe80::ec58:dcd9:e70f:383e%wlan0 prefixlen 64 scopeid 0x3
	inet 192.168.111.14 netmask 0xffffff00 broadcast 192.168.111.255
	groups: wlan
	ssid xxx channel 5 (2432 MHz 11g ht/20) bssid 04:f0:21:1b:b5:f2
	regdomain FCC country US authmode WPA2/802.11i privacy ON
	deftxkey UNDEF AES-CCM 2:128-bit txpower 30 bmiss 10 scanvalid 60
	protmode CTS ampdulimit 64k ampdudensity 8 -amsdutx amsdurx shortgi
	-stbc -ldpc wme roaming MANUAL
	media: IEEE 802.11 Wireless Ethernet MCS mode 11ng
	status: associated
	nd6 options=1<PERFORMNUD>

lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	ether f0:de:f1:64:c2:2a
	inet6 fe80::f2de:f1ff:fe64:c22a%lagg0 prefixlen 64 scopeid 0x4
	inet 192.168.111.14 netmask 0xffffff00 broadcast 192.168.111.255
	laggproto failover lagghash l2,l3,l4
	laggport: em0 flags=5<MASTER,ACTIVE>
	laggport: wlan0 flags=0<>
	groups: lagg
	media: Ethernet autoselect
	status: active
	nd6 options=1<PERFORMNUD>

The whole network setup on that machine is described under the "Laptop" section:
https://meka.rs/blog/2016/12/24/freebsd-wifi-and-ethernet-bridging-and-aggregation/
Just in case you need to replicate it.

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

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ć
Archive administrator: postmaster@marples.name