Wireless network connection in FreeBSD system

Source: Internet
Author: User
Tags dmesg

Insert the system, automatically recognized, you can see the following information in the/var/log/messages:

The code is as follows Copy Code

Mar 22:29:16 rzsing Kernel:ugen2.2:at usbus2
Mar 22:29:16 rzsing Kernel:urtwn0:on usbus2

The system version is as follows:

The code is as follows Copy Code
root@rzsing:~ # Uname-a
FreeBSD rzsing 10.0-release FreeBSD 10.0-release #0 r260789:thu 22:34:59 UTC 2014 root@snap.freebsd.org:/usr/ob J/usr/src/sys/generic AMD64

Load module:
Modify/boot/loader.conf, join

The code is as follows Copy Code
################
### Wireless ###
################
Legal.realtek.license_ack=1 # License
Firmware_load= "YES" # does not load this will prompt for missing firmware module
If_urtwn_load= "Yes" this is the kernel drive of this USB wireless network card

Wlan_scan_ap_load= "YES"
Wlan_scan_sta_load= "YES"
Wlan_wep_load= "YES"
Wlan_ccmp_load= "YES"
Wlan_tkip_load= "YES"

To automatically start the urtwn. In addition to WLAN modules, you must manually indicate the drivers wlan_wep, wlan_ccmp, and Wlan_tkip. The two drivers for wlan_ccmp and Wlan_tkip are only for WPA and 802.11i security protocols. I prefer WPA, which is better than WEP encryption from a security point of view.

Wireless network connection
No line by the setting is very simple, since needless to say. I chose to use the WPA-PSK security type, so I set up/etc/wpa_supplicant.conf, which reads as follows:

The code is as follows Copy Code
network={
Ssid= "Freebsdap"
psk= "xxxxxxxx"
}

Where FREEBSDAP is my wireless router's SSID,PSK (ie pre-shared key) is set by the user, with the wireless routing PSK key. Whether using WEP or WPA, it is necessary to set a password if you do not want your machine to be hacked. Additional needs to be included in the/etc/rc.conf

The code is as follows Copy Code
# WiFi
Wlans_urtwn0= "Wlan0" # This must be the same as the Ifconfig list of wireless card names
ifconfig_wlan0= "WPA DHCP"

This can be automatically assigned to the IP address from the router when it is started.
First, we confirm that the NIC is recognized.

The code is as follows Copy Code
# DMESG | grep Wireless
root@rzsing:~ # DMESG | grep Wireless
# This one is from the notebook, not done, so I bought the following USB wireless network card
Iwn0:mem 0xf7f00000-0xf7f01fff IRQ to device 0.0 on PCI3

# DMESG | grep Urtwn0
Urtwn0:on Usbus2
Urtwn0:mac/bb Rtl8188cus, RF 6052 1T1R # Turns out to be a rtl8188cus chip.

And then

The code is as follows Copy Code
Ifconfig wlan0 Create Wlandev Urtwn0
Ifconfig wlan0 up scan
Service Netif Start # This will automatically connect you to the wireless access IP address, of course, if configured correctly, the power-on can be automatically connected to wireless.

# ifconfig Urtwn0

where "status:associated" means that the wireless network is connected and can surf the Internet.
Fix your resolv.conf.
If you use DHCP, there is a problem that may keep harassing you, that is, the DNS recorded in/etc/resolv.conf will be modified from time to time. Of course, in addition to violence,

The code is as follows Copy Code
#chflags schg/etc/resolv.conf


Let it not be modified, but also can be very simple to solve the problem, is to add to the/etc/dhclient.conf

The code is as follows Copy Code

Prepend domain-name-servers 8.8.8.8, 8.8.4.4;
# "man 5 dhclient.conf" for details.

Detailed configuration WiFi to view FreeBSD official documents:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.