you can create a lagg failover device to easily switch between wired and wireless using the built in wifi
but its also possible to use an external usb wifi card as well
in this example i will be using a Alfa-AWUS036NH wireless card
i have a Macbook Pro Retina 2015 running Freebsd 14.1 p6
and the wifi card isnt supported so i need to use an external wifi card
there are a couple of difference using a lagg device with an external wifi card
instead of a built in wifi card
the alfa wifi card is identified as run0
1 - edit your loader.conf
add the following code for the alfa card
if you are using another type of card change the code below as needed
reboot to load the changes
2 - get the wifi card ether address
find the wifi card ether address
4 - edit your rc.conf
create a lagg failover device between ethenet and wifi
change ifconfig_ue0 to the name of your ethernet device
and change "ether 00:c0:ca:32:9c:f4"
to the wlan0 mac address of the wifi card which you can find with ifconfig
5 - edit your pf.con
edit your pf and change the int_if to lagg0
6 - reboot
reboot to pick up the changes
Notes
1 - wifi without ethernet plugged in
wifi should work automatically without the ethernet cable plugged in
2 - ethernet without wifi plugged in
if you are ethernet without the wifi card plugged in then you need to restart netif
lagg failover with a external wifi card notes on github
mabook pro retina 2015 config
for a lagg failover with ethernet and wifi
With lagg(4), it is possible to configure a failover which prefers the Ethernet connection, while maintaining the ability to transfer data over the wireless connection.
This is achieved by overriding the Ethernet interface’s MAC address with that of the wireless interface.
Freebsd Handbook
Example 3. Failover Mode Between Ethernet and Wireless Interfaces
but its also possible to use an external usb wifi card as well
in this example i will be using a Alfa-AWUS036NH wireless card
i have a Macbook Pro Retina 2015 running Freebsd 14.1 p6
and the wifi card isnt supported so i need to use an external wifi card
there are a couple of difference using a lagg device with an external wifi card
instead of a built in wifi card
the alfa wifi card is identified as run0
1 - edit your loader.conf
Code:
sudo vi /boot/loader.conf
add the following code for the alfa card
if you are using another type of card change the code below as needed
Code:
# ralink wifi
if_run_load="YES"
runfw_load="YES"
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
reboot to load the changes
2 - get the wifi card ether address
Code:
sudo ifconfig wlan0 create wlandev run0
find the wifi card ether address
Code:
ifconfig
4 - edit your rc.conf
create a lagg failover device between ethenet and wifi
change ifconfig_ue0 to the name of your ethernet device
and change "ether 00:c0:ca:32:9c:f4"
to the wlan0 mac address of the wifi card which you can find with ifconfig
Code:
sudo vi /etc/rc.conf
Code:
# laggo failover device
# ethernet mac address set to wifi mac address
ifconfig_ue0="ether 00:c0:ca:32:9c:f4"
wlans_run0="wlan0"
ifconfig_wlan0="WPA"
create_args_wlan0="country GB"
cloned_interfaces="lagg0"
ifconfig_lagg0="up laggproto failover laggport ue0 laggport wlan0 DHCP"
5 - edit your pf.con
edit your pf and change the int_if to lagg0
Code:
sudo vi /etc/pf.conf
Code:
int_if="lagg0" # lagg0 failove
6 - reboot
reboot to pick up the changes
Notes
1 - wifi without ethernet plugged in
wifi should work automatically without the ethernet cable plugged in
2 - ethernet without wifi plugged in
if you are ethernet without the wifi card plugged in then you need to restart netif
Code:
sudo service netif restart
lagg failover with a external wifi card notes on github
cerberus/freebsd/lagg-external-wifi-card.org at master · NapoleonWils0n/cerberus
cerberus code library. Contribute to NapoleonWils0n/cerberus development by creating an account on GitHub.
github.com
mabook pro retina 2015 config
for a lagg failover with ethernet and wifi
GitHub - NapoleonWils0n/freebsd-root-macbook: freebsd root macbook pro retina 2015
freebsd root macbook pro retina 2015. Contribute to NapoleonWils0n/freebsd-root-macbook development by creating an account on GitHub.
github.com
With lagg(4), it is possible to configure a failover which prefers the Ethernet connection, while maintaining the ability to transfer data over the wireless connection.
This is achieved by overriding the Ethernet interface’s MAC address with that of the wireless interface.
Freebsd Handbook
Example 3. Failover Mode Between Ethernet and Wireless Interfaces
Chapter 34. Advanced Networking
Advanced networking in FreeBSD: basics of gateways and routes, CARP, how to configure multiple VLANs on FreeBSD, etc
docs.freebsd.org