Chinaunix首页 | 论坛 | 博客
  • 博客访问: 731490
  • 博文数量: 130
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 2198
  • 用 户 组: 普通用户
  • 注册时间: 2011-11-29 12:48
个人简介

每一个“丑得人神共愤”的泡妞高 手都有一颗坚忍的心,这证明了人类 在绝境中毫不妥协的求生精神,反正丑都丑了,索性放开手脚大干一场,这就叫“无产阶级失去的是锁链,得到的是全世界”

文章分类

全部博文(130)

文章存档

2013年(130)

我的朋友

分类: LINUX

2013-09-26 16:27:29

AP信息:ESSID:whx-cpe 认证模式:open认证,地址为192.168.11.33,开启dhcp

  1. iwconfig
wlan2     IEEE 802.11abgn  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.
  1. ifconfig wlan2
wlan2     Link encap: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)
  1. sudo ifconfig wlan2 up
  2. ifconfig wlan2
wlan2     Link encap:Ethernet  HWaddr 68:7f:74:72:00:53  
          UP 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)
  1. 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: 48ms ago
                    IE: Unknown: 00077768782D637065
                    IE: Unknown: 010882848B960C121824
                    IE: Unknown: 030106
                    IE: Unknown: 0706434E20010D3F
                    IE: Unknown: 2A0104
                    IE: Unknown: 32043048606C
                    IE: Unknown: 2D1AAD0103FFFF000000000000000000000000000000000000000000
                    IE: Unknown: 331AAD0103FFFF000000000000000000000000000000000000000000
                    IE: Unknown: 3D1606000100000000000000000000000000000000000000
                    IE: Unknown: 341606000100000000000000000000000000000000000000
                    IE: Unknown: DD180050F2020101830003A4000027A4000042435E0062322F00
                    IE: Unknown: DD0900037F01010000FF7F

  1. sudo iwconfig wlan2 essid whx-cpe
  2. iwconfig wlan2
wlan2     IEEE 802.11abgn  ESSID:"whx-cpe"  
          Mode:Managed  Frequency:2.437 GHz  Access 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
  1. dhclient wlan2
  2. ifconfig wlan2
wlan2     Link encap:Ethernet  HWaddr 68:7f:74:72:00:53  
          inet addr:192.168.11.151  Bcast:192.168.11.255  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)
  1. 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访问192.168.11.33可打开网关主页,至此连接成功。
其中需要注意的这个过程中,我们是先和AP认证关联,然后再获得IP地址,获得IP地址的方法可以是DHCP,也可以是静态。
可以认为认证关联和IP配置没有关系!!!



AP信息:ESSID:whx-cpe 认证模式:wpa-pskifc加密,密钥:whx-cpee,地址为192.168.11.33,开启dhcp
安装wpasupplicant
  1. sudo apt-get install wpasupplicant
清除wlan2的wifi关联
  1. sudo iwconfig wlan2 essid ""
清除wlan2的ip配置
  1. sudo ifconfig wlan2 0.0.0.0


  1. 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: 2776ms ago
                    IE: Unknown: 00077768782D637065
                    IE: Unknown: 010882848B960C121824
                    IE: Unknown: 030106
                    IE: Unknown: 0706434E20010D3F
                    IE: Unknown: 2A0104
                    IE: Unknown: 32043048606C
                    IE: Unknown: DD180050F2020101810003A4000027A4000042435E0062322F00
                    IE: Unknown: DD0900037F01010000FF7F
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (1) : TKIP
                        Authentication Suites (1) : PSK
  1. wpa_passphrase whx-cpe whx-cpee > wpa.conf
  2. cat wpa.conf
network={
    ssid="whx-cpe"
    #psk="whx-cpee"
    psk=6c50c71830a47aa6f59c3ed0f28e6f89a1dff2570f8b5b03d1d7d575992e7b3b
}
  1. iwconfig wlan2
wlan2     IEEE 802.11abgn  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
  1. wpa_supplicant -Dwext -iwlan2 -c./wpa.conf
另起一个窗口,或者运行上一条命令是加个&在后台运行
  1. iwconfig wlan2
wlan2     IEEE 802.11abgn  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

从上面可用看出与AP认证关联成功,配置静态IP
sudo ifconfig wlan2 192.168.11.157
至此可访问AP主页,要想访问外网还得配置DNS、route等
阅读(2283) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~