I'm trying to use a USB WiFi adapter to connect to a wireless router.
I assume the adapter is brought to life with the correct driver, because
# iwconfig gives some reasonable output:
wlan0 IEEE 802.11bg ESSID:"MYNET" Mode:Managed Frequency:2.462 GHz Access Point: 00:1C:4A:A6:8F:0E Bit Rate=54 Mb/s Tx-Power=20 dBm Retry long limit:7 RTS thr:off Fragment thr:off Encryption key:off Power Management:on Link Quality=70/70 Signal level=-40 dBm Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:49 Missed beacon:0
Also, I assume that the authentication between the router and my adapter was successful, because
# wpa_cli status says "COMPLETED":
Selected interface 'wlan0' bssid=00:1c:4a:a6:8f:0e ssid=MYNET id=0 mode=station pairwise_cipher=CCMP group_cipher=TKIP key_mgmt=WPA2-PSK wpa_state=COMPLETED address=00:0d:0b:35:ca:14
Question 1: With information like this, am I correct to assume that my adapter runs fine as interface wlan0, and that the router has accepted my key and is ready and willing to establish a connection? I am not having any WPA2 authentication issues?
Now, to use wlan0, it needs an ip address, and the router is set up as a DHCP server, with DHCP addresses ranging from 192.168.2.100 to 192.168.2.199. As far as I understand the DHCP negotiation process, dhclient should work with the defaults, i.e. it broadcasts at 255.255.255.255, and the router should answer as 0.0.0.0, finally issuing an available address. Hoewever,
# dhclient wlan0 -v, just gives up after a while:
Internet Systems Consortium DHCP Client 4.2.2 Copyright 2004-2011 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ Listening on LPF/wlan0/00:0d:0b:35:ca:14 Sending on LPF/wlan0/00:0d:0b:35:ca:14 Sending on Socket/fallback DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 3 DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 6 DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 15 DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8 DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8 DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 10 DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 11 No DHCPOFFERS received. No working leases in persistent database - sleeping.
Question 2: (Probably the harder part to answer?) Why is the broadcast DHCPDISCOVER not getting a proper reply, i.e. a DHCPOFFER?
Some more info and hints on possible gotchas I may or may not be running into:
- The router does not use MAC filtering.
- Using a static ip outside the router's DHCP range (192.168.2.70), I was able to connect and even get into the router's html configuration tool at 192.168.2.1.
- The box I'm trying to connect from has a wired interface (eth0). Any chance that the DHCP client request from wlan0 is not sent over the air in order to establish a DHCP ip connection on 192.168.2.0, but into my wired subnet (192.168.1.0/255.255.255.0)? There's no DHCP server on the wired subnet, so the DHCP request may just end up being lost in 192.168.1.0/24? How would I debug and rule out something like this?
- The box has Debian wheezy (7.0) installed. Having used the box in a wired subnet with static ip addresses, I may have forgotten to change a configuration somewhere that may be needed for dhclient to work.