原文标题:WiFi configuration in FreeBSD (including WPA/WPA2)
wireless device is called ndis0
假设无线网卡为ndis0
assume that you are using WPA/WPA2 and DHCP
使用了WPA/WPA2加密方式,并且开启了DHCP
add the following lines into /etc/rc.conf:
wlans_ndis0=”wlan0″
ifconfig_wlan0=”WPA DHCP”
将以上两行参数,添加到文件/etc/rc.conf
assume we have 2 wireless networks for this – “wifi1” and “wifi2” which have the WPA/WPA2 keys of “one” and “two” respectively. We will prefer to connect to “wifi1” when possible.
假设我们有两个无线网络,wifi1和wifi2。并且密码分别为one和two。优先选择wifi1。
To setup WPA/WPA, edit (or create) the file /etc/wpa_supplicant.conf and add the following:
network={
priority=1
ssid=”wifi1″
psk=”one”
}network={
priority=2
ssid=”wifi2″
psk=”two”
}
设置WPA/WPA2。编辑(不存在则新建)/etc/wpa_supplicant.conf文件,添加以上内容到该文件中。
Next time you restart your computer, you will have a ‘wlan0’ interface which will attempt to connect to the listed networks (in order of priority). You can confirm it is associated withifconfig wlan0 – in my case, i get:
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether xx:xx:xx:xx:xx:xx
inet 172.31.0.100 netmask 0xffffff00 broadcast 172.31.0.255
media: IEEE 802.11 Wireless Ethernet autoselect mode 11g
status: associated
ssid wlan1 channel 7 (2442 Mhz 11g) bssid yy:yy:yy:yy:yy:yy
country US authmode WPA2/802.11i privacy OFF txpower 0 bmiss 7
mcastrate 0.5 mgmtrate 0.5 scanvalid 60 protmode CTS roaming MANUAL
bintval 0
下次启动电脑,wlan0就会尝试连接无线列表中的网络。可以使用ifconfig wlan0命令确认。
Now, although it says “11g”, it actually achieves 802.11n speeds so you can ignore this.
尽管显示的是11g类型,但确使用的11n方式的网速,可以忽略掉。
官方配置文档:
https://www.freebsd.org/doc/handbook/network-wireless.html
https://wiki.freebsd.org/WiFi