Notebook Network Config For OpenBSD

This document describes a convenient network configuration for notebooks with OpenBSD. I use the trunk(4) interface to switch between wired and wireless network connections. A wired connection is preferred over wifi, because its more reliable. The ifstated(8) it used to trigger link-state changes on the wired interface, so dhcpleased(8) is notified to renew the dhcp lease.

This setup works best where WIFI and wire are on the same network. The fixed MAC address on the trunk(4) interface guaranties the same IP address on WIFI and wire. Thus, you can switch between them without losing network sessions.


trunkproto failover
trunkport em0
trunkport iwm0
lladdr xx:xx:xx:xx:xx:xx
inet6 autoconf
inet autoconf




join 'Home Wi-Fi' wpa wpakey 'xxxxxxxx'
join 'Free Wi-Fi'


if ||
	run "dhcpleasectl trunk0 > /dev/null"


# rcctl enable ifstated
# rcctl start ifstated
# sh /etc/netstart