FreeBSD无线网络连接(WPA/WPA2加密方式)

原文标题: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

转载于:https://my.oschina.net/u/877598/blog/906409

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值