Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

My workplace uses 802.11x authentication for their WiFi network, and several times per day I get booted from the network and need to do the following:

  1. Disable networking
  2. sudo kill -9
  3. Restart networking

At this point, the machine will connect to the network just fine. I don't see any weirdness in the syslog, and am running Ubuntu 12.04 (64-bit). What could be wrong?

share|improve this question

2 Answers 2

up vote 5 down vote accepted

I had the same problem. It turns out that Network manager is a little overzealous in switching between access points (AP's) when more than one are present. You have two options

  1. Use iwlist to find out how many AP's are there:

    root@debian:/home/nofrills# iwlist wlan0 scan
    
    Scan completed :
      Cell 01 - Address: 00:1E:58:A1:41:87
                ESSID:"iiserk_wireless"
                Mode:Managed
                Frequency:2.462 GHz (Channel 11)
                Quality:4/5  Signal level:-64 dBm  Noise level:-92 dBm
                IE: IEEE 802.11i/WPA2 Version 1
                    Group Cipher : TKIP
                    Pairwise Ciphers (2) : TKIP CCMP
                    Authentication Suites (1) : 802.1x
                   Preauthentication Supported
                Encryption key:on
                Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                          12 Mb/s; 24 Mb/s; 36 Mb/s; 9 Mb/s; 18 Mb/s
                          48 Mb/s; 54 Mb/s
    
      Cell 02 - Address: 00:1E:58:A1:54:7B
                ESSID:"iiserk_wireless"
                #More such details
    

    Then note the Address of the cell with the highest Quality. That is the AP nearest to you. Then click on Network manager applet, select "Edit Connections" and go to the wifi network listed. There will be a text box titled "BSSID". Paste the Cell address there.

  2. Otherwise, you can ditch network manager altogether and use wpa_supplicant (Network manager uses it under the hood anyway). Just create a configuration file and edit your /etc/network/interfaces this way:

    auto lo
    iface lo inet loopback
    
    auto wlan0
    iface wlan0 inet dhcp
        pre-up wpa_supplicant -B -Dwext -i wlan0 -c/etc/wpa_supplicant.conf
        post-down killall -q wpa_supplicant 
    

Option 1 is not very useful unless you spend most of your time at workplace in roughly the same location. Option 2 is what I am using now, and it works pretty well. But wifi does not get automatically reconnected after suspend/resume, so you need to run /etc/init.d/networking/restart manually.

share|improve this answer
    
Very helpful answer! Unfortunately I think your configuration of /etc/network/interfaces in your 2nd point wasn't pasted in. Can you please re-add it? –  Nik Reiman Nov 9 '12 at 15:03
    
Oops! My bad. Added it. –  nofrills Nov 11 '12 at 14:03

sudo service network-manager stop

It will stop NetworkManager

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.