Add yourself to network group first
pw groupmod network -m yourself
Set wifi command line
1. Check if wlan is configured
ifconfig
2. If not, find the device
lsusb ## for usb wifi
root@:/home/rjp # lsusb
Bus /dev/usb Device /dev/ugen2.2: ID 148f:3572 Ralink Technology, Corp. RT3572 WirelessAdapter
3. Check kldstat
kldstat
root@:/home/rjp # kldstat
Id Refs Address Size Name
1 23 0xffffffff80200000 1f41458 kernel
2 1 0xffffffff82820000 3390 acpi_wmi.ko
3 1 0xffffffff82824000 4250 ichsmb.ko
4 1 0xffffffff82829000 2178 smbus.ko
5 1 0xffffffff8282c000 3360 uhid.ko
6 1 0xffffffff82830000 4364 ums.ko
7 1 0xffffffff82835000 11f60 if_run.ko
4. List wlan devices
sysctl -h net.wlan.devices
root@:/home/rjp # sysctl -h net.wlan.devices
net.wlan.devices: run0 ath0
5. Create wlan interface
ifconfig wlan1 create wlandev
root@:/home/rjp # ifconfig wlan1 create wlandev run0
6. Make /etc/wpa_suppicant.conf file
nano /etc/wpa_suppicant.conf
… my file
network={
ssid="rjpownnetwork"
proto=RSN
key_mgmt=WPA-EAP
eap=TLS
identity="loader"
ca_cert="/etc/certs/cacert.pem"
private:key="/etc/certs/clientkey.pem"
private:key_passwd="verysceredpassword"
}
7. Scan created wlan
ifconfig wlan1 up list scan
… my result after rebooting
SSID/MESH ID BSSID CHAN RATE S:N INT CAPS
rjpownnetwork c0:c9:e3:96:dc:e7 3 54M -26:-49 100 EP HTCAP WPA RSN WME WPS
8. Edit /etc/rc.conf file adding wlan section
wlans_run0="wlan1"
ifconfig_wlan1="WPA DHCP"
9. Reboot
https://docs.freebsd.org/en/books/handbook/advanced-networking/#network-wireless
Other useful network commands
https://srobb.net/fbsdquickwireless.html
Network re-start
#!/bin/sh
#
# RJP 25.6.2025 restart network script
# Packages sudo, networkmgr, xterm and yad must be installed
#
#
yad --text="Would like to restart network?" --title="QUESTION"
if [ $? = 0 ];
then
/bin/sh -c "xterm -e 'sudo service netif restart' && yad --center --borders=5 --width=400 --text-align=center --button=ok:1 --title='Network re-started' --buttons-layout=center"
else exit 0
fi
Edit 29.6.2025: Monitor traffic command works in linux, but not in BSD
Network monitoring
#!/bin/sh
# RJP 27.6.2025
# simple script for monitoring network traffic
#
xterm -e watch netstat -tunlap