Wpa supplicant usage

From D3xt3r01.tk
Jump to navigationJump to search

WHAT

Recently I've upgraded my router's (Asus WL520g) firmware to dd-wrt and decided to not take the "risk" of anyone else using my router anymore ( not that I'd care anyway ).

So, I set it up as wpa2 personal ( TKIP+AES ) and disabled the essid broadcast. Here's where wpa_supplicant comes into play. I'm using FEDORA on this box.

HOW

First edit the config in /etc/sysconfig/wpa_supplicant and set up the variables needed there.

INTERFACES="-iwlan0" # wlan0 is the interface in my case
DRIVERS="-Dwext" # wext seems to work 
OTHER_ARGS="-d -u -f /var/log/wpa_supplicant.log" # I added -d to be a lil bit more verbose in the log

Now in /etc/wpa_supplicant/wpa_supplicant.conf you should have something like this:

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
ap_scan=1

network={
	scan_ssid=1
	ssid="networkname"
        proto=WPA2
        key_mgmt=WPA-PSK
        pairwise=CCMP TKIP
        group=CCMP TKIP
        psk="password_here"
}

You can use wpa_passphrase to generate an encrypted version of the psk password like this:

[root@hostname ~]# wpa_passphrase networkname
# reading passphrase from stdin
password_here
network={
	ssid="networkname"
	#psk="password_here"
	psk=4dbebea58d3e74aba769575d14211cd48f9826dbeb35a22285779ed9b5826908
}

and you can replace the unencrypted psk line with the one generated encrypted here.

And that's it folks. If there's anything wrong be sure to check out /var/log/wpa_supplicant.log and wpa_supplicant homepage