Set up a trunk device
Trunk interface automatically connects to one of multiple Ethernet or wifi devices.
Trunks are virtual interfaces consisting of one or more network interfaces. In this section, our example will be a laptop with a wired bge0 interface and a wireless iwn0 interface. We will build a trunk(4) interface using both of them. The wired and wireless interfaces must be connected to the same layer two network.
The listed devices are
2. Ethernet device
/etc/hostname.em0 to contain only
3. Wifi device
/etc/hostname.iwm0 add WiFi networks. One per each line separated by a space
join $SSID wpakey $PASSWORD and add
up on the last line. In the photo below passwords are deleted but they come after wpakey.
4. Trunk device
Create a new file for the trunk device.
Add the following lines to it. Change the names of interfaces as needed to match your own.
trunkproto failover trunkport em0 trunkport iwm0 inet autoconf
5. Restart network
Should connect to WiFi, if not