8

I'm getting the message 'Network Connection Failed' frequently when I connect to wifi using 12.04. I was using the same connection without any problems, in Ubuntu 10.04 and Windows Vista. What might be the reason why my connection is terminating so frequently while using only the Ubuntu 12.04 version? How to resolve this issue?

I have tried connecting to internet using usb Ethernet through my mobile phone. Then it worked out properly. Connection is not getting terminated as with wlan interface. So I think the problem might be with wlan modem. But then, how come wlan works well in Windows and older versions of Ubuntu. And the problem is for 12.04 alone.

0

4 Answers 4

3
+100

Install wicd network manager. It should work. It's available in Ubuntu software Center.

Its all in the signal strength. The Network Manager would oscillate around -28db to 70db (meaning a large fluctuation). And with Wicked (WICD), it's around a -70 tops.

I would recommend to install EtherApe or WireShark to analyze your network connection.

sudo apt-get install wireshark
sudo apt-get install etherape
1
  • I installed wicd network manager. And then rebooted my system. Now it is working properly. No problem of frequent termination :) The wlan is quite okay in such a tool. But what might be the reason for getting it right using wicd and not with Network Manager?
    – sruthi
    Jul 2, 2012 at 16:39
1

I'd look at power management. The card may be disconnecting if the network is inactive for more than a short period of time. You could also look at how often Ubuntu wireless tries to refresh its key.

1

Appreciating the problem:

  1. Like you, wireless networking worked for me in version 10.04 LTS. This was also true for questions 31483, 67077, and others that are all closed as "too localized". This is an IAQ (Infrequently Answered Question).

  2. My wireless network is slower on Ubuntu than on Windows boxes, or even the same machine booted into Windows.

  3. I get a peculiar saw-toothed graph of ping times from my laptop to a wireless router (e.g., 10.0.0.1 or 192.0.0.1 at home). Here are my ping milliseconds from my laptop to my coffee shop's AP, adding parenthesis to illustrate the saw-tooth cycle.

    (36, 59, 81, 104, 127) (47, 59, 92, 116) (36, 59, 81, 104) (24, 150; 73,92,114) (38,48,81,103) (23,45,67,91) ...

  4. I can connect to some coffee shop APs and not others. The results are almost, but not always the same. Once in a blue moon, I do connect to an AP I had written off as not connectable.

  5. Much of the syslog is verbose, about 50 lines for an attempt to connect. Much is concerned with the unused IPv6. In comparing a good connection versus a bad connection, a good connection does (DHCPDISCOVER then DHCPREQUEST then receives DHCPOFFER) while a failing connection does DHCPDISCOVER and has no DHCPREQUEST or DHCPOFFER lines.

Gathering the Information

Many questions like this have no great information. Here's a bit of help in gathering information:

The usual most relevant log is /var/log/syslog which collects all sorts of random information. A wireless connection generally generates at least 100 lines.

# tail -20 /var/log/syslog    ;# see the last 20 lines of the log
# tailf /var/log/syslog       ;# watch the log expand with usage.
# logger ====== Trying again  ;# add a message to the syslog

Another log is dmesg, the kernel ring buffer. It might, but usually wont say anything useful. The usual networking message is "No IPv6 Routers Present"

# dmesg | tail -3   ;# look at last three lines
[  422.328274] eth1: no IPv6 routers present
[  474.578004] eth1: no IPv6 routers present
[ 3327.234898] eth1: no IPv6 routers present

The ifconfig command relates to networking interfaces, both wired and unwired. It shows, and can configure, hardware addresses and packet counts.

# ifconfig -a   ;# show all interfaces, configured or not
# ifconfig eth1 ;# just show eth1
eth1      Link encap:Ethernet  HWaddr c4:17:fe:71:59:f1  
          inet addr:192.168.19.79  Bcast:192.168.19.255  Mask:255.255.255.0
          inet6 addr: fe80::c617:feff:fe71:59f1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7549 errors:0 dropped:0 overruns:0 frame:18706
          TX packets:7230 errors:142 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:6541083 (6.5 MB)  TX bytes:960689 (960.6 KB)
          Interrupt:17 

The iwconfig command is about wireless interfaces. Note that you want to run this as root because it sometimes gives abbreviated results from the user account.

# iwconfig eth1   ;# show eth1 wireless information
eth1      IEEE 802.11abgn  ESSID:"Quickly-WiFi"  
          Mode:Managed  Frequency:2.412 GHz  Access Point: 06:16:16:03:6A:10   
          Bit Rate=11 Mb/s   Tx-Power:24 dBm   
          Retry min limit:7   RTS thr:off   Fragment thr:off
          Power Managementmode:All packets received
          Link Quality=1/5  Signal level=-85 dBm  Noise level=-90 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:145  Invalid misc:0   Missed beacon:0

You might also use these commands:

# cat /etc/lsb-release  ;# See your current Ubuntu version
# lshw -c network       ;# See your networking hardware, at least what's recognized.
# ls /etc/modprode.d    ;# config probing hardware, blacklists, and add exceptions
# lsmod                 ;# which modules are used by what
# lspci                 ;# more hardware information
# rfkill list all       ;# see status of hardware and software on/off switches
# nc                    ;# a hard to use swiss army knife of networking.

Troubleshooting and Solutions

There seems to be a sequence of hints.

  1. Rule out the careless. Make sure your wireless in enabled, make sure you have the right password, etc. Boot in Windows to check. Look for the DHCPDISCOVER but not request in /var/log/syslog.

  2. Start seeing where networking breaks. Ping loopback (127.0.0.1), try with wired to the access point, try pinging out (74.125.244.39 is Google), try pinging google.com (using DNS). Try a wget on http://www.google.com.

  3. Try blacklisting your wireless card or suspending the hardware probe using files in /etc/modprobe.d.

  4. Try going into the network manager and giving yourself a fixed, reasonable IP address and see the router then answers you.

  5. Try rebooting. There are occasional problems with network cards coming back from power saving modes.

  6. There are some known issues detailed in Hardware Support as well.

Good luck, and I'll try to update this answer from comments.

3
  • Sometimes I could see DHCPDISCOVER followed by DHCPREQUEST and receiving DHCPOFFER. And at other times DHCPREQUEST and receiving DHCPACK These are repeatedly coming with certain millisecond intervals. While pinging loopback, its showing no problems But while pinging say, 74.125.244.39, sometimes its showing 'Network unreachable'; othertimes its ok. But not letting it to transfer the whole packets. Before that, its getting terminated.Please let me know how can I get a solution for this type of problem. And it always comes when I try to connect to wlan.
    – sruthi
    Jul 1, 2012 at 17:17
  • On checking /var/log/syslog, I could see: >wlan0: no IPv6 routers present >wlan0: IP6 addrconf timed out or failed. >wlan0 Stage 4 of 5 (IPv6 Confg Timeout) scheduled. >wlan0 Stage 4 of 5 (IPv6 Config Timeout) started. >device state change: activated->failed (reason 'ip-config-unavailable') >wlan0 failed for access point (ITI) After few milliseconds: >compile time options: IPv6 GNU-getopt DBus i18n DHCP TFTP conntrack IDN >no upstream servers configured >wlan0: supplicant interface state: completed -> disconnected >Auto-activating connection 'ITI' >wlan0 starting connection 'ITI'
    – sruthi
    Jul 1, 2012 at 17:22
  • Did you check with your network manager setup whether IPv6 is "mandatory" for a successful connection (there's a checkbox for that in the IPv6 tab). If so, try unchecking that. Could very well be that the failed IPv6 causes disconnects otherwise.
    – Izzy
    Jul 2, 2012 at 14:24
1

I apologies for the late response (since it's already solved), however, one helpful thing I found with this issue was to connect my laptop on to the wired network, and physically create the "WEP" password for the connection.

It appears Ubuntu was trying to connect to the wireless network, The router asked for a password, but Ubuntu decides to throw an "invalid authentication" i.e. "Connection failed Activate connection failed." instead of allowing you to enter the passphrase.

This fixed the issue for me.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .