Configuring Ubuntu 6.10 (Edgy) to work with WPA2 Personal with AES and hidden SSID
By Chee Ming on Sep 10, 2007 | In Technical, Exoweb, Ubuntu | Send feedback »
I wanted to connect my Ubuntu to the wireless configuration mentioned above and realised that my GNOME network manager only supported WEP. I did a bit of research online and found a ton of info but the most useful for my case was the wifi doc from Ubuntu website. By the way, I am using a Dell Inspiron 510m.
I did a bit of hacking around and finally found a way.
- Install WPA supplicant like this: apt-get install wpasupplicant (requires root access)
Create the config file for WPA supplicant. I saved it at
/var/run/wpa_supplicant.conf/etc/wpa_supplicant/wpa_supplicant.conf (you probably need root access). It will look something like this:network={ ssid="[ENTER SSID HERE]" scan_ssid=1 # use this when access point using hidden ssid proto=WPA key_mgmt=WPA-PSK psk=[ENTER PSK HERE] # generate this using wpa_passphrase }- Generate your PSK using the wpa_passphrase program
Edit the /etc/network/interfaces file (again root access). For my setup it is eth1 for the wireless. So I just put the following
23 lines afteriface eth1 inet dhcpas such:auto eth1 iface eth1 inet dhcp wpa-driver wext wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf wireless-essid [ENTER SSID HERE]
wext is the driver that I am using. I guess this might be different depending on your setup. Check the man for wpa_supplicant to get an idea. The wpa-conf part points to the config file that was created earlier. The wireless-essid setting is also required, although it seems there is a duplication.
There is a line that looks like
auto eth1which doesn't seem to matter where its placed but I put it before the line containingiface eth1 inet dhcpjust to be safe (and consistent).
- Finally, restart the network like this:
/etc/init.d/networking restart. You can check if you get an IP address from the access point by usingifconfig (root access!).
You can troubleshoot just the wireless authentication part with the following command (root access!):
/sbin/wpa_supplicant -i eth1 -D wext -c /etc/wpa_supplicant/wpa_supplicant.conf
As you can see, replace eth1 with your wireless network device and wext with the driver that works for you. The /var/run/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf is the config file you created earlier. You should see something like this if everything works well:
Trying to associate with 00:16:01:ad:88:71 (SSID='[YOUR SSID HERE]' freq=0 MHz)
Associated with 00:16:01:ad:88:71
WPA: Key negotiation completed with 00:16:01:ad:88:71 [PTK=CCMP GTK=CCMP]
CTRL-EVENT-CONNECTED - Connection to 00:16:01:ad:88:71 completed (auth)
[id=0 id_str=]
If you don't get the message above, please run iwconfig and see if your wireless network interface is already associated with any of the access points. If not, you need to set it explicitly with iwconfig eth1 essid [YOUR SSID HERE] and try running the wpa_supplicant again.
If something breaks, just go back to edit your config file and retry until it works.
Hope that helps people out there with similar configs! ![]()
Update: /var/run is a bad place to put config files as it will clear the stuff there on each restart. I should have realised this earlier!
. Also added additional info about setting the ssid before running wpa_supplicant.
No feedback yet
Comments are not allowed from anonymous visitors.
| « Up close and personal with Erlang | How do I find out my own mobile number? » |
