Connect to a wireless network using cli in ubuntu

Source: Internet
Author: User
Tags crypt
In ubuntu, the cli connects to the wireless network without: offanyMode: ManagedAccessPoint: Not-AssociatedTx-Power = 20 dBmRetrylonglimit: 7 RTSthr: o in ubuntu, the cli connects to the wireless network iwconfigwlan2 IEEE 802.11 abgn ESSID: off/any Mode: Managed Access Point: Not-Associated Tx-Power = 20 dBm Retry long limit: 7 RTS thr: off Fragment thr: off Power Management: on lo no wireless extensions. eth0 no wireless extensions. ifconfig wlan2wlan2 Link enc Ap: Ethernet HWaddr 68: 7f: 74: 72: 00: 53 broadcast multicast mtu: 1500 Metric: 1 RX packets: 10944 errors: 0 dropped: 0 overruns: 0 frame: 0 TX packets: 10209 errors: 0 dropped: 0 overruns: 0 carrier: 0 collisions: 0 txqueuelen: 1000 RX bytes: 6214930 (6.2 MB) TX bytes: 1032870 (1.0 MB) sudo ifconfig wlan2 upifconfig wlan2wlan2 Link encap: Ethernet HWaddr 68: 7f: 74: 72: 00: 53 up broadcast multicast mtu: 1500 Metric: 1 RX pa Ckets: 10944 errors: 0 dropped: 0 overruns: 0 frame: 0 TX packets: 10209 errors: 0 dropped: 0 overruns: 0 carrier: 0 collisions: 0 txqueuelen: 1000 RX bytes: 6214930 (6.2 MB) TX bytes: 1032870 (1.0 MB) sudo iwlist wlan2 scan Cell 01-Address: 00: 03: 7F: BE: 0A: 01 Channel: 6 Frequency: 2.437 GHz (Channel 6) Quality = 31/70 Signal level =-79 dBm Encryption key: off ESSID: "whx-cpe" Bit Rates: 1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb /S; 6 Mb/s 9 Mb/s; 12 Mb/s; 18 Mb/s Bit Rates: 24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s Mode: Master Extra: tsf = 000000000d6ad4c6 Extra: Last beacon: 48 ms ago IE: Unknown: 030106 IE: Unknown: 0706434E20010D3F IE: Unknown: 2A0104 IE: Unknown: 32041748606c IE: Unknown IE: unknown: 331AAD Consumed IE: Unknown: 341606000100000000000000000000000000000000000000 IE: Unknown: dd0900037f010109ff7f sudo iwconfig wlan2 essid whx-cpeiwconfig wlan2wlan2 IEEE 802.11 abgn ESSID: "whx-cpe" Mode: Managed Frequency: 2.437 GHz Acces S Point: 00: 03: 7F: BE: 0A: 01 Bit Rate = 6.5 Mb/s Tx-Power = 20 dBm Retry long limit: 7 RTS thr: off Fragment thr: off Power Management: on Link Quality = 27/70 Signal level =-83 dBm Rx invalid nwid: 0 Rx invalid crypt: 0 Rx invalid frag: 0 Tx excessive retries: 5 Invalid misc: 0 Missed beacon: 0 dhclient wlan2ifconfig wlan2wlan2 Link encap: Ethernet HWaddr 68: 7f: 74: 72: 00: 53 inet addr: 192.168.11.151 Bcast: 192.168.11.25 5 Mask: 255.255.255.0 inet6 addr: fe80: 6a7f: 74ff: fe72: 53/64 Scope: Link up broadcast running multicast mtu: 1500 Metric: 1 RX packets: 10955 errors: 0 dropped: 0 overruns: 0 frame: 0 TX packets: 10226 errors: 0 dropped: 0 overruns: 0 carrier: 0 collisions: 0 txqueuelen: 1000 RX bytes: 6216678 (6.2 MB) TX bytes: 1035222 (1.0 MB) route-n ...................... 0.0.0.0 192.168.11.33 0.0.0.0 UG 0 0 0 wlan2 ...................... 192.168.11.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan2 ...................... Web access 192.168.11.33 to open the gateway home page, the connection is successful. In this process, we first associate with AP authentication and then obtain the IP address. the IP address can be obtained through DHCP or static. It can be considered that the Authentication Association has nothing to do with the IP address configuration !!! AP information: ESSID: whx-cpe authentication mode: wpa-pskifc encryption, key: whx-cpee, address: 192.168.11.33, enable dhcp to install strongapt-get install wpasupplicant clear wlan2 wifi connection sudo iwconfig wlan2 essid "" clear wlan2 ip configuration sudo ifconfig wlan2 0.0.0.0 sudo iwlist wlan2 scan Cell 04-Address: 00: 03: 7F: BE: 0A: 01 Channel: 6 Frequency: 2.437 GHz (Channel 6) Quality = 29/70 Signal level =-81 dBm Encryption key: on ESSID: "whx-cpe" Bit Rates: 1 Mb/s, 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s 9 Mb/s; 12 Mb/s; 18 Mb/s Bit Rates: 24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s Mode: Master Extra: tsf = 000000000039d180 Extra: Last beacon: 2776 ms ago IE: Unknown: 030106 IE: Unknown: 0706434E20010D3F IE: Unknown: 2A0104 IE: Unknown: 32034748606c IE: Unknown: weight ie: WPA Version 1 Group Cipher: TKIP Pairwise Ciphers (1 ): TKIP Authentication Suites (1): PSKwpa_passphrase whx-cpe whx-cpee> wpa. confcat wpa. confnetwork = {ssid = "whx-cpe" # psk = "whx-cpee" psk = secure} iwconfig wlan2wlan2 IEEE 802.11 abgn ESSID: off/any Mode: Managed Access Point: not-Associated Tx-Power = 20 dBm Retry long limit: 7 RTS thr: off Fragment thr: off Power Management: onwpa_supplicant-Dwext-iwlan2-c. /wpa. conf starts a window, or runs the previous command to add and run iwconfig wlan2wlan2 IEEE 802.11 abgn ESSID: "whx-cpe" Mode: Managed Frequency: 2.437 GHz Access Point: 00: 03: 7F: BE: 0A: 01 Bit Rate = 1 Mb/s Tx-Power = 20 dBm Retry long limit: 7 RTS thr: off Fragment thr: off Power Management: on Link Quality = 27/70 Signal level =-83 dBm Rx invalid nwid: 0 Rx invalid crypt: 0 Rx invalid frag: 0 Tx excessive retries: 0 Invalid misc: 0 Missed beacon: 0 from the above, we can see that the connection with AP authentication is successful. configuring static IPsudo ifconfig wlan2 192.168.11.157 can access the AP home page. to access the Internet, you must configure DNS and route.
 
Related Article

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.