Personal tools
You are here: Home cmgui Wiki Wireless access using linux
Views
FrontPage >> Peters notes >> Useful tips from Peter >>

Wireless access using linux

last edited 1 year ago by pbier

Introduction

Setting up a linux machine to use the university wifi network is non trivial. I suggest getting a friendly sysadmin involved. With the help of Andrew Cantell I finally have wifi access from linux. Here are a few things I learnt in the process of getting it to work.

Bringing the ethernet interface up (or down)

If you start fiddling with your ethernet cable, pulling it out or plugging it back in after your computer has booted up you may need to restart your ethernet interface. Rather than rebooting try the following to bring it up:

    sudo ifup eth0

To bring it down use:

    sudo ifdown eth0

Configuring the wireless interface

The following two files are important

  • ~/.wpa/wpa_supplicant.conf
  • /etc/network/infterfaces

My wpa_supplicant.conf file looks like this:

    # IEEE 802.1X with dynamic WEP keys using EAP-PEAP/MSCHAPv2

    ctrl_interface=/var/run/wpa_supplicant

      eapol_version=1
      ap_scan=1
      fast_reauth=1

    network={
            ssid="uoa"
            scan_ssid=1
            key_mgmt=IEEE8021X
            eap=PEAP
            phase2="auth=MSCHAPV2"
            identity="EC\UPI_HERE"
            password="PASSWORD_HERE"
            ca_cert="/etc/ssl/certs/Verisign_Class_3_Public_Primary_Certification_Authority_-_G2.pem"
            ca_cert2="/etc/ssl/certs/Verisign_Class_3_Public_Primary_Certification_Authority_-_G2.pem"
    }

You will need to insert your upi in place of UPI_HERE and your network password in place of PASSWORD_HERE.

My interfaces file looks like this:

    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).

    # The loopback network interface
    auto lo
    iface lo inet loopback

    # The primary network interface
    auto eth0
    iface eth0 inet dhcp

    iface ath0 inet dhcp
            wpa-conf /home/pbie003/.wpa/wpa_supplicant.conf

Bringing the wireless interface up (or down)

To bring up the wireless interface type:

    sudo ifup ath0

This command will poll your connection (often 5 or 6 times before it connects). In my experience, if it doesn't work the first time you run it, try running the command again. If it fails after the second attempt at exectution try bring the interface down and then back up again:

    sudo ifdown ath0
    sudo ifup ath0

Restarting your network

If things seem screwy you can try to restart you network software. For example if you unplug your ethernet cable while your machine is running (or plug it back in) you may need to restart your networking software to detect the connection. You can probably do this with the ifup command but if that fails try the following command:

    sudo /etc/init.d/networking restart

Testing

The first thing to test is you can ping other machines. Try:

    ping www.google.co.nz

Or you could try pinging bioeng10.

If that doesn't work it may be because your network ip address lookup isn't working. Try:

    nslookup www.google.co.nz

If this command works and spits back an ip address this is a good sign.

Note that to use firefox (or your browser of choice) you may need to change your preferences for your networking settings from the usual to something like "Direct connection".

Contributing to this site

Please add to the wiki any relevant information that you think might be useful to other users of this website. For example, you might like to contribute your experiences, questions and answers.

You are encouraged to contribute to this site regardless of your level of experience. Contributions are welcomed from new and regular visitors.

If you ask a question and receive an answer from a developer you should record it in the wiki. This information is extremely useful and can help other users overcome the same problem.

See how to add and edit pages for more information.