Skip to content

Instantly share code, notes, and snippets.

@sjmf
Last active February 24, 2023 23:25
Show Gist options
  • Save sjmf/0071b750c23dcbeb8ae0a0d448c52343 to your computer and use it in GitHub Desktop.
Save sjmf/0071b750c23dcbeb8ae0a0d448c52343 to your computer and use it in GitHub Desktop.
How to connect to University WPA Enterprise RADIUS WiFi on a Rasperry Pi

How to connect to University WPA Enterprise RADIUS WiFi on a Rasperry Pi

  1. Plugin the WiFi adapter to your raspberry pi.

  2. Start your Raspberry Pi

3. Connect to Wifi with GUI

3.1. Run WiFi Config application (you may find it on the desktop)
3.2. From WiFi Config Wizard select Manage Network tab
3.3. Click Scan - A scan wizard opens
3.4. From the scan wizard select newcastle-university network. If there are more than one newcastle-university network then select the first one in the list.

Note: to select a network you need to double click it - This opens the network wizard

You should see the following:

SSID:		newcastle-university
Authentication:	WPA2-Enterprise (EAP)
Encryption:	CCMP
EAP method:	PEAP      (if this is not PEAP then select it from the list)
Identity:	Your_Uni_ID 	(ex. b4050601)
Password:	Your_Uni_Password

If your settings is different than above then change it to match, and leave everything else as is.

3.5. Save - This will close this wizard and show the main one
3.6. From the main wizard go to Current Status wizard
3.7. You will see the application is trying to connect to the newtork. Wait for a few moment.
3.8. Check status, if successful it must read Completed (station) and you should have an IP address (shown just above the connect button on the same wizard)

You are now done.

4. Alternatively: Connect to WiFi with Terminal

4.1. Run your terminal (LXTerminal)
4.2. Type

$ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

it should look like this

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

4.3. Now add the following (if not already there)

network={
        ssid="newcastle-university"
        proto=RSN
        key_mgmt=WPA-EAP
        pairwise=CCMP
        auth_alg=OPEN
        eap=PEAP
        identity="b1234567"
        password="Your_Password"
}

Note: dont enter your plain password here. Instead you better md4 hash it.

(Put a space before the following command to prevent it entering your history!)

To do so, open another terminal and type:

echo -n Your_Password | iconv -t utf16le | openssl md4 > hash.txt

this will save the hashed password to a temp hash.txt file.

If you forgot to put the space in front, clear the terminal history enter the following commands

$ history -w
$ history -c

Now go back to the terminal with wpa_supplicant.conf file and:

  • move the cursor to the password line and just after the equal sign
  • type enter
  • insert two double quotes
  • move the cursor to be between the two double quotes
  • press Ctrl+R and type hash.txt to insert the hash code (your hashed password)
  • now replace (stdin)= with hash:

your password should look like this (but with different hashed code)

password=hash:9a3a20fcdd1e850612fd6119ad112233

now click Ctrl+x to save - then click y and click enter to complete and exit

network={
	ssid="newcastle-university"
	proto=RSN
	key_mgmt=WPA-EAP
	pairwise=CCMP
	auth_alg=OPEN
	eap=PEAP
	identity="ngf37"
	password=hash:fe313479bd7136eafc4334b2574cb90c
}

5. Connect automatically at boot-time:

Open up the terminal and edit the network interfaces file:

$ sudo nano /etc/network/interfaces

This file contains all known network interfaces, it'll probably have a line or two in there already.

Change the first line (or add it if it's not there) to:

auto wlan0

Then at the bottom of the file, add these lines telling the Raspberry Pi to allow wlan as a network connection method and use the /etc/wpa_supplicant/wpa_supplicant.conf as your configuration file.

allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="newcastle-university"
proto=RSN
key_mgmt=WPA-EAP
pairwise=CCMP
auth_alg=OPEN
eap=PEAP
identity="a123456"
password=hash:REPLACETHISWITHYOURHASH
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment