From charlesreid1

(Created page with "To connect to a WPA wireless network from a Raspberry Pi: First add network configuration to /etc/wpa_supplicant/wpa_supplicant.conf <pre> ctrl_interface=DIR=/var/run/wpa_su...")
 
No edit summary
Line 41: Line 41:
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
iface default inet dhcp
</pre>
Now bring the wireless card down and back up:
<pre>
ifdown wlan0
ifup wlan0
</pre>
You should see the wireless network you specified in your wpa supplicant file when you run iwconfig:
<pre>
iwconfig
</pre>
You should also see an IP address when you run ifconfig:
<pre>
ifconfig
</pre>
</pre>

Revision as of 23:09, 29 July 2016

To connect to a WPA wireless network from a Raspberry Pi:

First add network configuration to /etc/wpa_supplicant/wpa_supplicant.conf

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"
}

Next edit /etc/network/interfaces and modify the wlan0 entry.

If you have a static IP:

# ------ Static IP --------
###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

If you have an automatically-assigned IP from the DHCP controller:

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

Now bring the wireless card down and back up:

ifdown wlan0
ifup wlan0

You should see the wireless network you specified in your wpa supplicant file when you run iwconfig:

iwconfig

You should also see an IP address when you run ifconfig:

ifconfig