Configuring the Raspberry Pi for WPA2-Enterprise

I recently started a project that required my Raspberry Pi to log in to a university network that requires both an identity and a password.  All of my experience with wifi networks involved an SSID and a password.

After a little head banging, I was able to figure this out, and I thought I would try to save some of you a little of the frustration I encountered.

All of this was done through the terminal, and it is pretty straightforward.  I should state that this procedure should be a good guide for you.  The kinds of things that are needed from your network will vary based on how it is set up.  If you work for a company, I strongly suggest contacting the IT department.  They hate surprises, and you never want to surprise them.

Run wpa_cli



This is, apparently, a program that will make changes to your /etc/wpa-supplicant/wpa-supplicant.conf file.  You run through things one line at a time.



This will show all of the network connections that your Raspberry Pi can see.  I was interested in one called SPC.



This will create a new network connection for you.  It is like adding another wifi network that your Raspberry Pi can use to get online. A number will appear when you do this.  My number is ‘2’.  That means my Pi will try to connect to network 0 and network 1 before connecting to this new network.

set_network 2 ssid "SPCWifi"

I am telling the Pi that the SSIF is SPCWifi.  This will, of course, change for you depending on your SSID of interest.

set_network 2 identity "yourusername"

This is your username.  Once you complete this and hit enter, you will get an ‘OK’ letting you know that it worked.

set_network 2 password "yourpassword"

The password you use to get on your network.  Depending on your network you may need to substitute password with psk.

set_network 2 key_mgmt WPA-EAP

This is the type of security you are running.  This is specifically for a WPA2-Enterprise system.

set_network eap PEAP

This might have something to do with security.  My network needed it.  Admittedly my knowledge is thin here.

enable_network 2

This enables the network so it can be used.


This saves the configuration you just created, and thus saves the changes to your /etc/wpa_supplicant/wpa_supplicant.conf file.


This quits the wpa_cli program, and brings you back to the command line. Now lets reboot the wlan0.

sudo ifdown wlan0

sudo ifup wlan0


Now you should see your wlan0 configuration with an internet address.


There is a reasonable chance that you might need more information about your network before this is successful for you.  Be prepared to try a few different things.  I found this video to be an excellent resource.  Without it, I would still be beating my head against a wall.

Leave a Reply

Your email address will not be published. Required fields are marked *