To test that your wireless device can see the network, try:
$ sudo iwlist scanning
It should show you lots of details on all the networks it can see.
At Thu, 8 Apr 2010 09:13:48 +0100, Paul Grenyer wrote:
Hi
If you want to use DHCP you could go for something like:
allow-hotplug wlan1 iface wlan1 inet auto wpa-driver wext wpa-ssid Your SSID wpa-psk yourwpakey
I'm not sure how hotplug and wireless devices mix. It's probably incredibly clever and would make completely unnecessary the manual approach I take, but on the other hand it could just be confusing.
A iwconfig suggests that my wireless adapter is wlan0. So I tried:
allow-hotplug wlan1 iface wlan1 inet auto wpa-driver wext wpa-ssid Your SSID wpa-psk yourwpakey
obviously with my SSID and my wpa-psk.
I may be very out of touch, but I use wpa-supplicant to manage my authenticated wireless network connections. So I have something like:
iface wlan0 inet dhcp wireless-essid foobar pre-up wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf post-down killall -q wpa_supplicant
in my /etc/network/interfaces
and then
ctrl_interface=/var/run/wpa_supplicant ctrl_interface_group=root network={ ssid="foobar" key_mgmt=WPA-PSK psk="password" }
in my /etc/wpa_supplicant/wpa_supplicant.conf
when I: /etc/init.d/networking restart
I get:
/etc/network/interfaces:19: unknown method
Line 19 for me is:
iface wlan1 inet auto
If I change that too:
iface wlan1 inet dhcp
Then I can restart nextworking, but there's no sign of wlan0. If I change too:
auto wlan1 iface wlan1 inet dhcp wpa-driver wext wpa-ssid Your SSID wpa-psk yourwpakey
Still not convinved by all this 'auto' stuff.
and restart networking wlan0 tries to connected, but I get:
Listening on LPF/wlan0/00:26:5a:87:37:ca Sending on LPF/wlan0/00:26:5a:87:37:ca Sending on Socket/fallback DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 7 DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 9 DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 13 DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 21 DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 11 No DHCPOFFERS received. No working leases in persistent database - sleeping.
I'm still completely lost here......
In my experience, you get this when the wireless device is working OK, but it can't get an IP address from the router. This could be a DHCP issue, but it could also be an authentication issue.
There may be more information in your /var/log/messages.
Finally, if this is Ubuntu, why not try removing (or commenting out) *everything* from /etc/network/interfaces and allowing NetworkManager to do it all for you?