Configuring WPA2 using wpa_supplicant on the Raspberry Pi

By the way, this was extremely helpful getting my wifi dongle running with a hidden wpa2 connection running wheezy.

kerneldriver

To use WPA2 pre-shared key on the Raspberry Pi, you will first need to add a network configuration to “/etc/wpa_supplicant/wpa_supplicant.conf”. Note the lack of space in “network={“.

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="Your SSID Here"
    proto=RSN
    key_mgmt=WPA-PSK
    pairwise=CCMP TKIP
    group=CCMP TKIP
    psk="YourPresharedKeyHere"
}

After you have modified wpa_supplicant.conf, you will need to change the “wlan0” section of “/etc/network/interfaces”. For a static IP, it will look like this:

# allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet static
    address 10.1.2.20
    netmask 255.255.255.0
    network 10.1.2.0
    gateway 10.1.2.1

For DHCP, it will look like this:

# allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

After that, you will need to bring up the “wlan0” interface using “ifup”:

# sudo ifup wlan0

You may have to bring the interface down and then back up:

# sudo ifdown wlan0
# sudo ifup wlan0

You may see messages like this:

View original post 145 more words

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s