Connect Raspberry Pi to PEAP-MSCHAP v2 Wireless Networks

Raspberry Pi 3 Model BThe Raspberry Pi 3 Model B, compared to older models, comes with a built in WiFi support. However, connecting it to a PEAP-MSCHAP v2 wireless network does not seem to be a straightforward task. While the dhcpdui that ships with Raspbian is able to connect to WPA-PSK networks it is unable to do so for PEAP-MSCHAP v2. This tutorial focuses on configuring your Raspberry Pi in a way that enables PEAP-MSCHAP wireless network connections.

At the moment of writing this tutorial I own a Raspberry Pi 3 Model B running Raspbian Jessie with PIXEL. All the following information may also apply to future Raspbian releases.

The Solution

The wireless network configuration is kept in a file named wpa_supplicant.conf. This file is located under /etc/wpa_supplicant path. Here is where Raspbian keeps the connection settings for all your WiFi networks. Once you connect to a wireless network a new entry is added to this file. Our job is to add a new configuration entry telling Raspbian how to connect to a PEAP-MSCHAP v2 network.

Before we begin we will need the SSID name of the network and the domain credentials for connecting to the network. Also, because we don’t want to store the password in plain text we will compute the NTLM Hash. Open up a terminal window and type in the following command. Make sure to use your real password.

echo -n "plaintext_password_here" | iconv -t utf16le | openssl md4

The 32 characters long string that comes after (stdin)= is what we need. With this information in hand we can proceed to edit the wpa_supplicant.conf file.

In the same terminal type:

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

Append the configuration below to the end of the file. Replace ssid_name and your_user_name with the correct values. Also replace the_hash with the hash value computed above.

network={
        ssid="ssid_name"
        priority=1
        proto=RSN
        key_mgmt=WPA-EAP
        pairwise=CCMP
        auth_alg=OPEN
        eap=PEAP
        identity="your_user_name"
        password=hash:the_hash
        phase1="peaplabel=0"
        phase2="auth=MSCHAPV2"
}

Take extra care on line number 10 that is highlighted. Line number 10 should be something like

password=hash:895ce55c09433e717f02f83041f85599

not

password=895ce55c09433e717f02f83041f85599

Save the file and we are done.

Now that you are able to connect to PEAP-MSCHAP v2 networks maybe you will need to find the IP address of the Raspberry Pi. Take a look into one of my previous articles for a solution:

Send your Raspberry Pi IP address to Gmail on boot

T3ZlciBBbmQgT3V0IQ==

Recent Posts

Be First to Comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.