Summary The method for configuring wireless wife in two command line modes has been tested in practice (Red Hat Enterprise Linux release 6.0 beta (Santiago ))
1. Use the wpa_supplicant command (mainly to configure the WPA-PSK, WPA2-PSK encryption AP)
1. Disable the NetworkManager service.
You must disable the NetworkManager service. Otherwise, various errors may occur during the connection.
[[email protected] ~]# /etc/init.d/NetworkManager stop
2. Configure the wpa_supplicant.conf file (add the AP user name and password)
ctrl_interface=/var/run/wpa_supplicantctrl_interface_group=wheelnetwork={ssid="wtms"psk="test1234"}
3. Start the wireless Nic
The wireless network card on my machine is wlan0.
[[email protected] ~]# ifconfig wlan0 up
4. Run wpa_supplicant in the background (this program must be run in the same way)
[[email protected] ~]# wpa_supplicant -B -c/etc/wpa_supplicant/wpa_supplicant.conf -iwlan0
-B: running in the background
-C: Configuration File
-I: Nic
5. Check whether the connection is successful.
[[email protected] ~]# iwconfig wlan0wlan0 IEEE 802.11abgn ESSID:"wtms" Mode:Managed Frequency:2.412 GHz Access Point: A8:57:4E:1A:D8:F0 Bit Rate=0 kb/s Tx-Power=15 dBm Retry long limit:7 RTS thr:off Fragment thr:offEncryption key:offPower Management:off
The connection is successful. Essid: "wtms"
In this case, the wlan0 still does not obtain the IP address through ifconfig.
6. dynamically allocate IP addresses
[[email protected] ~]# dhclient wlan0
After successful execution, you can access the Internet.
7. Test
[[email protected] ~]# ping www.baidu.comPING www.a.shifen.com (180.97.33.107) 56(84) bytes of data.64 bytes from 180.97.33.107: icmp_seq=1 ttl=54 time=24.3 ms64 bytes from 180.97.33.107: icmp_seq=2 ttl=54 time=24.9 ms64 bytes from 180.97.33.107: icmp_seq=3 ttl=54 time=21.0 ms
Ii. Configure the WEP encryption AP using the iwconfig command
The WEP encryption method is out of date and is rarely used now, mainly because it is too insecure and can be cracked at will, but there are still some old APs, here we will summarize how to configure WiFi in this way, which is helpful for learning.
1. Disable the NetworkManager service.
You must disable the NetworkManager service. Otherwise, various errors may occur during the connection.
[[email protected] ~]# /etc/init.d/NetworkManager stop
2. Start the wireless Nic
The wireless network card on my machine is wlan0.
[[email protected] ~]# ifconfig wlan0 up
3. directly use iwconfig to connect to wifi
[[email protected] ~]# iwconfig wlan0 essid "wtms" key s:test1234
4. Check whether the connection is successful.
[[email protected] ~]# iwconfig wlan0wlan0 IEEE 802.11abgn ESSID:"wtms" Mode:Managed Frequency:2.412 GHz Access Point: A8:57:4E:1A:D8:F0 Bit Rate=0 kb/s Tx-Power=15 dBm Retry long limit:7 RTS thr:off Fragment thr:offEncryption key:offPower Management:off
The connection is successful. Essid: "wtms"
In this case, the wlan0 still does not obtain the IP address through ifconfig.
5. dynamically allocate IP addresses
[[email protected] ~]# dhclient wlan0
After successful execution, you can access the Internet.
6. Test
[[email protected] ~]# ping www.baidu.comPING www.a.shifen.com (180.97.33.107) 56(84) bytes of data.64 bytes from 180.97.33.107: icmp_seq=1 ttl=54 time=24.3 ms64 bytes from 180.97.33.107: icmp_seq=2 ttl=54 time=24.9 ms64 bytes from 180.97.33.107: icmp_seq=3 ttl=54 time=21.0 ms
After the above configuration, you can access the Internet, but it is troublesome to configure again after each restart. In the future, we will summarize how to automatically connect to the network at startup in command line mode.
RedHat wireless (WiFi) command line configuration