|
|
| (2 intermediate revisions by the same user not shown) |
| Line 1: |
Line 1: |
| To connect to a WPA wireless network from a Raspberry Pi:
| | See [[Linux/Wireless/1]] for method 1 and [[Linux/Wireless/2]] for method 2. |
|
| |
|
| First add network configuration to /etc/wpa_supplicant/wpa_supplicant.conf
| | {{PiFlag}} |
| | | {{KaliFlag}} |
| <pre>
| | {{LinuxFlag}} |
| 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"
| |
| } | |
| </pre>
| |
| | |
| Next edit /etc/network/interfaces and modify the wlan0 entry.
| |
| | |
| If you have a static IP:
| |
| | |
| <pre>
| |
| # ------ 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
| |
| </pre>
| |
| | |
| If you have an automatically-assigned IP from the DHCP controller:
| |
| | |
| <pre>
| |
| # ------- DHCP ------------
| |
| ###allow-hotplug wlan0
| |
| iface wlan0 inet manual
| |
| wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
| |
| 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>
| |
| | |
| To start wpa_supplicant manually:
| |
| | |
| <pre>
| |
| # sudo /sbin/wpa_supplicant -P /var/run/wpa_supplicant.wlan0.pid -i wlan0 \
| |
| -D nl80211,wext -c /etc/wpa_supplicant/wpa_supplicant.conf
| |
| </pre>
| |