Setting up Eduroam on Raspberry Pi

Anyone who has ever used Eduroam on a Raspberry pi will know that it’s no easy task to set it up. Fortunately, it is possible, it just takes a lot of trial and error.

This has been tested on a Pi2, Pi3, and a model b+ with a WiFi adapter.

How to set up an Eduroam WiFi connection on Raspberry pi:

Firstly, you will need to find out your university’s network information – this will vary depending on which university you are at. As this guide is made (and tested) for Plymouth University, you may have to find your own university’s information. In this case, the information was readily available on the university’s website — you will need to look this up in case there are any differences (this part is up to you!).

Before you start, you may need to stop network connections:

sudo service networking stop

Warning:  This will disable any currently open network connections – if you are using your Raspi with SSH, this will disconnect it, so be sure to do this using a mouse/keyboard/screen.

Security

If you have used WiFi on a Raspberry Pi before, you may have noticed your password is stored in plain text – this is not okay! We can combat this by hashing it. You can convert your password by opening a command prompt and typing in:

read -s input ; echo -n $input | iconv -t utf16le | openssl md4

then type in your password. It will feed back a hashed version of your password. This needs to be added to the the ‘wpa_supplicant.conf’ file as indicated later.

 

Editing the Config files

The two files we need to edit are ‘/etc/wpa_supplicant/wpa_supplicant.conf’ and ‘/etc/network/interfaces’. What you put into these files depends on your university’s network.

The first can be edited in the terminal by typing:

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

in ‘wpa_supplicant’:

   ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
     update_config=1
country=GB
     network={
ssid=”eduroam”
scan_ssid=1 scan_ssid=1
    proto=RSN
key_mgmt=WPA-EAP
pairwise=CCMP TKIP pairwise=CCMP TKIP
group=CCMP TKIP
eap=PEAP
phase2=”auth=MSCHAPV2″
identity=”<eduroam-username>”
password=hash:<eduroam-password-hashed-using-iconv-and-openssl>
id_str=”eduroam”
     }

where <eduroam username> is your usual eduroam login and <eduroam password> is the hashed password.

Next, edit ‘interfaces’ by typing into the terminal:

sudo nano /etc/network/interfaces

and adding in:

 auto lo wlan0
     iface lo inet loopback
     iface eth0 inet dhcp
     iface wlan0 inet dhcp
        wpa-driver wext
        wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
     iface default inet dhcp

 

You may also need your university’s security certificate – this can usually be found with the other details for manually connecting to your university’s WiFi. Once you have found it, add it to the folder ‘/etc/ssl/certs/’ and then link back to it from within your ‘wpa_supplicant.conf’ file by adding:

ca_cert=”/etc/certs/<NameofCert>”

where ‘/etc/certs/<NameofCert>’ is the name/location of the certificate needed.

Once this is done, you will need to run wpa_supplicant:

sudo wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -B

You may need to reboot to get it to connect.

Troubleshooting

You may find that your Raspberry pi resets key_mgmt to “none” on connecting to Eduroam and lists as “disassociated from Eduroam” – if this is the case, you may find it easier to work on a copy and overwriting the original with the Eduroam version.

Useful links

Eduroam for RasPi at Bristol University

Eduroam for RasPi at Cambridge University

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 )

Connecting to %s