Enable the Broadcom BCM43224 wifi for the Macbook Air 2011
and optionally create a lagg failover device
to automatically switch between ethernet and wifi
Freebsd Handbook
notes on github
1 - install the net/bwn-firmware-kmod port
you can use poudriere to install the port if you use packages
instructions in the links above
2 - loader.conf
edit your loader.conf
add the following options
3 - rc.conf
3a - standard wifi connection
you can use either DHCP or SYNDHCP with ifconfig_wlan0
dhcp
syndhcp
3b - lagg failover
create a lagg failover device between ethenet and wifi
change ifconfig_ue0 to the name of your ethernet device
and change "ether 04:0c:ce:d5:b0:ae"
to the wlan0 mac address of the wifi card which you can find with ifconfig
it will be listed under wlan0 and look like this
and add the following options to your rc.conf
4 - build the custom kernel
we need to build a custom kernel to enable the wifi driver
switch to root
Do not make edits to GENERIC.
Instead, copy the file to a different name and make edits to the copy.
change into the /usr/src/sys/amd64/conf directory
copy the GENERIC file to WIFI
edit the WIFI file
/usr/src/sys/amd64/conf/WIFI
add the code below to the WIFI file,
this will include the GENERIC kernel using the include option,
and use the ident option to change the identity name to the name of your custom kernel which is the same as the name of the file.
search for bwn and uncomment the device bwn line
it should be line 297
at the end of the file add the following options
An include directive is available for use in configuration files. This allows another configuration file to be included in the current one, making it easy to maintain small changes relative to an existing file. If only a small number of additional options or drivers are required, this allows a delta to be maintained with respect to GENERIC, as seen in this example:
Using this method, the local configuration file expresses local differences from a GENERIC kernel. As upgrades are performed, new features added to GENERIC will also be added to the local kernel unless they are specifically prevented using nooptions or nodevice.
5 - Compile the new kernel
Change to the /usr/src directory
compile the WIFI kernel
Install the new kernel associated with the specified kernel configuration file.
This command will copy the new kernel to /boot/kernel/kernel and save the old kernel to /boot/kernel.old/kernel:
6 - pf.conf
edit your pf.conf to set the in_if
if you want to use a standard wifi connection
set int_if to wlan0
if you want to use the lagg failover device
set int_if to lagg0
7 - reboot
Shutdown the system and reboot into the new kernel.
8 - scan for networks
9 - wpa_supplicant.conf
edit your wpa_supplicant.conf and add the wifi details
10 - connect to wifi
run wpa_supplicant with the network interface and path to the config
Once you're sure it's working, you can run it in the background, by adding the -B option.
note
if you are using SYNDHCP you will need to run dhclient
Macbook Air 2011
root config files
dotfiles
bin
and optionally create a lagg failover device
to automatically switch between ethernet and wifi
Freebsd Handbook
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
notes on github
cerberus/freebsd/broadcom-wifi.org at master · NapoleonWils0n/cerberus
cerberus code library. Contribute to NapoleonWils0n/cerberus development by creating an account on GitHub.
github.com
1 - install the net/bwn-firmware-kmod port
you can use poudriere to install the port if you use packages
instructions in the links above
2 - loader.conf
edit your loader.conf
Code:
sudo vi /boot/loader.conf
add the following options
Code:
# broadcom wifi
hw.bwn_pci.preferred="1"
bwn_v4_ucode_load="YES"
bwn_v4_n_ucode_load="YES"
bwn_v4_lp_ucode_load="YES"
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
3 - rc.conf
3a - standard wifi connection
you can use either DHCP or SYNDHCP with ifconfig_wlan0
dhcp
Code:
wlans_bwn0="wlan0"
ifconfig_wlan0="WPA DHCP"
syndhcp
Code:
wlans_bwn0="wlan0"
ifconfig_wlan0="WPA SYNDHCP"
3b - lagg failover
create a lagg failover device between ethenet and wifi
change ifconfig_ue0 to the name of your ethernet device
and change "ether 04:0c:ce:d5:b0:ae"
to the wlan0 mac address of the wifi card which you can find with ifconfig
Code:
ifconfig
it will be listed under wlan0 and look like this
Code:
wlan0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
options=0
ether 04:0c:ce:d5:b0:ae
and add the following options to your rc.conf
Code:
# laggo failover device - bwn
# ethernet mac address set to wifi mac address
ifconfig_ue0="ether 04:0c:ce:d5:b0:ae"
cloned_interfaces="lagg0"
wlans_bwn0="wlan0"
ifconfig_wlan0="WPA"
create_args_wlan0="country US regdomain FCC"
ifconfig_lagg0="up laggproto failover laggport ue0 laggport wlan0 DHCP"
4 - build the custom kernel
we need to build a custom kernel to enable the wifi driver
switch to root
Code:
su
Do not make edits to GENERIC.
Instead, copy the file to a different name and make edits to the copy.
change into the /usr/src/sys/amd64/conf directory
Code:
cd /usr/src/sys/amd64/conf
copy the GENERIC file to WIFI
Code:
cp GENERIC WIFI
edit the WIFI file
/usr/src/sys/amd64/conf/WIFI
Code:
vi WIFI
add the code below to the WIFI file,
this will include the GENERIC kernel using the include option,
and use the ident option to change the identity name to the name of your custom kernel which is the same as the name of the file.
Code:
cpu HAMMER
include GENERIC
ident WIFI
search for bwn and uncomment the device bwn line
it should be line 297
Code:
device bwn # Broadcom BCM43xx wireless NICs.
at the end of the file add the following options
Code:
options BWN_GPL_PHY
An include directive is available for use in configuration files. This allows another configuration file to be included in the current one, making it easy to maintain small changes relative to an existing file. If only a small number of additional options or drivers are required, this allows a delta to be maintained with respect to GENERIC, as seen in this example:
Using this method, the local configuration file expresses local differences from a GENERIC kernel. As upgrades are performed, new features added to GENERIC will also be added to the local kernel unless they are specifically prevented using nooptions or nodevice.
5 - Compile the new kernel
Change to the /usr/src directory
Code:
cd /usr/src
compile the WIFI kernel
Code:
make buildkernel KERNCONF=WIFI
Install the new kernel associated with the specified kernel configuration file.
This command will copy the new kernel to /boot/kernel/kernel and save the old kernel to /boot/kernel.old/kernel:
Code:
make installkernel KERNCONF=WIFI
6 - pf.conf
edit your pf.conf to set the in_if
Code:
sudo vi /etc/pf.conf
if you want to use a standard wifi connection
set int_if to wlan0
Code:
int_if="wlan0"
if you want to use the lagg failover device
set int_if to lagg0
Code:
int_if="lagg0"
7 - reboot
Shutdown the system and reboot into the new kernel.
8 - scan for networks
Code:
ifconfig wlan0 list scan
9 - wpa_supplicant.conf
edit your wpa_supplicant.conf and add the wifi details
Code:
sudo vi /etc/wpa_supplicant.conf
Code:
network={
ssid="Homezonexxxx-xxxxx"
psk="Komplexxxxx---xxxxx"
}
10 - connect to wifi
run wpa_supplicant with the network interface and path to the config
Code:
sudo wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf
Once you're sure it's working, you can run it in the background, by adding the -B option.
Code:
sudo wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf
note
if you are using SYNDHCP you will need to run dhclient
Code:
sudo dhclient wlan0
Macbook Air 2011
root config files
GitHub - NapoleonWils0n/freebsd-root: freebsd root dot files for mac air
freebsd root dot files for mac air. Contribute to NapoleonWils0n/freebsd-root development by creating an account on GitHub.
github.com
dotfiles
GitHub - NapoleonWils0n/freebsd-dotfiles: freebsd dotfiles for macbook air
freebsd dotfiles for macbook air. Contribute to NapoleonWils0n/freebsd-dotfiles development by creating an account on GitHub.
github.com
bin
GitHub - NapoleonWils0n/freebsd-bin: freebsd home bin directory
freebsd home bin directory. Contribute to NapoleonWils0n/freebsd-bin development by creating an account on GitHub.
github.com