WiFi
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.
1. Devices
List devices
ifcongig
The listed devices are
-
Ethernet
hostname.em0
-
WiFi
hostname.iwm0
-
Trunk
hostname.trunk0
2. Ethernet device
Edit the /etc/hostname.em0
to contain only up
3. Wifi device
Edit the /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.
nano /etc/hostname.trunk0
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
Run
/etc/netstart
Should connect to WiFi, if not reboot
.