Configuring Edimax EW-7811Un for WPA2 Enterprise Wireless
Most of the documentation out there involving Edimax EW-7811Un and Wifi has everyone connecting with a pre-shared key (PSK). My challenge is that the network I am running my RPi on uses WPA2 Enterprise. It utilizes credentials to log onto the wifi network. Fortunately, how to connect your Raspberry Pi to a WPA2 Enterprise wireless network is not that more difficult than connecting it to a WPA2 PSK network. In the end, I will show you how I configured my Edimax EW-7811Un to connect to a WPA2 Enterprise SSID.
My equipment involves:
- Raspberry Pi
- Edimax EW-7811Un 802.11n Wireless Adapter
You can purchase a starter kit, including the Edimax wireless adapter.
Prerequisites
Either connect to your Raspberry Pi using a keyboard or over the Ethernet connection.
Make sure the Edimax Wireless Adapter is recognized by issuing the lsusb command:
pi@raspberrypi ~ $ lsusb Bus 001 Device 005: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]
Modify your network interfaces
This is what my network interface configuration looks like. I opted to give my Raspberry Pi a static IP address.
If you wanted to use DHCP change iface wlan0 inet static to iface wlan0 inet dhcp and remove the next four lines.
The wpa_supplicant.conf file will hold the information needed to connect to our wireless network.
pi@raspberrypi ~ $ sudo nano /etc/network/interfaces auto lo iface lo inet loopback iface eth0 inet dhcp allow-hotplug wlan0 iface wlan0 inet static address 192.168.100.100 netmask 255.255.255.0 broadcast 192.168.100.255 gateway 192.168.100.1 wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf #iface default inet dhcp
WPA Supplicant
Now create or modify the wpa_supplicant.conf file.
pi@raspberrypi ~ $ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="WIFI-SSID"
scan_ssid=1
key_mgmt=WPA-EAP
identity="domainuser"
psk="password"
}
ssid is where you type out the name of your wireless network. Place the name of your network within the quotes.
scan_ssid is the method in which the SSID is scanned. 0 is the default meaning it scans for the SSID using a broadcast Probe Request frame. 1 uses a directed Probe Request frame.
key_mgmt is set to WPA-EAP for my WPA2 Enterprise wireless network. Other documentation will list this line as WPA-PSK for which you use when your wireless network uses a preshared key.
identity is where you enter your credentials to log into the wireless network. Type in your credentials in quotes. I recommend configuring a non-privileged account just for connecting to this wifi network because the credentials are stored on this configuration file.
psk is not really the preshared key but it is the password to account in the identity line.
Verification
To shut down the Edimax interface:
sudo ifdown wlan0
To enable the interface:
sudo ifup wlan0
When I performed sudo ifup wlan0 I received some error messages but I believe these were okay to ignore.
Enter the command ifconfig to verify your wlan0 now has an IP address
pi@raspberrypi ~ $ ifconfig
wlan0 Link encap:Ethernet HWaddr 80:1f:02:aa:4d:88
inet addr:192.168.100.100 Bcast:192.168.100.255 Mask:255.255.255.0
inet6 addr: fe80::821f:2fa:ffff:4e88/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:385651 errors:0 dropped:65139 overruns:0 frame:0
TX packets:325485 errors:0 dropped:1 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:41228949 (39.3 MiB) TX bytes:27281780 (26.0 MiB)
Verify connectivity by pinging the IP address of wlan0 and then try to SSH to your Raspberry Pi.
