If you're willing, here is an alternate method to connect to a router via terminal with a wireless adapter.
This is to unlock the wireless adapter:
Create the configuration file necesarry for Authentication.
File: /etc/wpa_supplicant/wireless_lab.conf
Insert code into wireless_lab.conf:
Code:
network={
ssid=""
key_mgmt=NONE
}
Initialize Authentication:
Note - Notice no spaces between the arguments and options in the correct example.
Wrong example:
-D wext -i wlan0 -c /etc/etc/wpa_supplicant/wireless_lab.conf
Correct:
Code:
wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant/wireless_lab.conf
Request an IP from router's DHCP:
Code:
dhclient -r
dhclient wlan0
You should now be able to ping the router itself and be on the network.
I'm not sure if you created a wireless AP and you're trying to get a connection with your wireless adapter.
If the router is proprietary (like a Zyxel or something) then you're mostly likely good to go.
If you created the AP, it might just be a DHCP issue.
When I created an AP I used isc-dhcp-server module to implement DHCP.
Hopefully I addressed this issue correctly and that it helps, cheers.