IllinoisNet Wireless – Command Line (Tested on Ubuntu 12.04 and 13.04)

Connecting to IllinoisNet through the command line

Since many people are having trouble maintaining a connection to IllinoisNet through the default NetworkManager in many distros, here’s how to connect to IllinoisNet just through the command line.

Step 1: Make sure wpa_supplicant is installed.

wpa_supplicant -v

Most distros probably come with it. Here’s the command to install it in Ubuntu, what you need to do may be different depending on your package manager.

sudo apt-get install wpa_supplicant

Step 2: Create a config file for wpa_supplicant named “wpa_supplicant.conf”, you can make it anywhere but it’s usually placed in /etc/ or /etc/wpa_supplicant/. Here I’m creating it inside /etc/wpa_supplicant/.

sudo touch /etc/wpa_supplicant/wpa_supplicant.conf

Step 3: Open up the file in a text editor.

gksudo gedit /etc/wpa_supplicant/wpa_supplicant.conf

And put the following into the file, replacing <your netid> with your NetID WITHOUT the “@illinois.edu” and <your password> with your password.

network={
        ssid="IllinoisNet"
        scan_ssid=1
        key_mgmt=WPA-EAP
        pairwise=CCMP TKIP
        group=CCMP TKIP
        eap=TTLS
        identity= <your netid>
        password= <your password>
        ca_cert="/etc/ssl/certs/AddTrust_External_Root.pem"
        phase2="auth=MSCHAPV2"
        }

Step 4: Stop NetworkManager, existing instances of wpa_supplicant, and anything else that may be using the wireless card.

sudo service network-manager stop
sudo killall wpa_supplicant

Step 5: Bring down the interface and start fresh. Replace <interface> with the name of your wireless interface(it’s wlan0 on my machine).

sudo ifconfig <interface> down
sudo dhclient -r <interface>

Step 6: Connect to IllinoisNet with wpa_supplicant. Once again, replace <interface> with the name of your interface. Also, change the file path to the .conf file if yours is in a different location

sudo wpa_supplicant -Dnl80211 -i<interface> -c/etc/wpa_supplicant/wpa_supplicant.conf -B

Step 7: Ask for an IP address. Again, <interface> is the name of your interface. Note, your GUI will give no visible indication whether you are connected or not. If this command terminates in a timely manner you probably succeeded.

sudo dhclient <interface>

When you’re done and wish to restore to your original state, kill wpa_supplicant and restart NetworkManager.

sudo killall wpa_supplicant
sudo service network-manager start
Shell Script

The .conf file will stay on your system after the first time, but you will have to go through steps 4-7 every time you connect to IllinoisNet. Going through this process each and every time you want to connect can get annoying. So instead of doing all this manually, after you create the .conf file, you can copy and paste the following into a shell script and just run the script each time you want to connect.

#!/bin/sh
# Script to set up connection to IllinoisNet
# Run as root
service network-manager stop
killall wpa_supplicant
ifconfig wlan0 down
dhclient -r wlan0
wpa_supplicant -Dnl80211 -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf -B
dhclient wlan0

The script should be run as root. Make sure execution is allowed.

sudo ./scriptname.sh