Internet very slow in Ubuntu

I have ubuntu 11.04 as the os, both surfing the net and downloading stuff is a pain, it is really slow. I have turned ipv6 off, my connection is properly configured, but still it is very slow. I checked the net speed on a friend's laptop, it is really fast, but on my pc it is mighty slow. I don't know what to do? help anyone.

PS- It is a wired connection.


For the cases about Ubuntu 11.04 and up here are some of the steps to find out what is wrong. We will assume the following:

  • You are using a wired connection (Not wirelessly. This will avoid other problems).
  • You have already tested the connection using, either another Distro, an older version of Ubuntu or Windows. When testing the speed it was much better than when using Ubuntu 11.04+. So we assume that the problem is ONLY on Ubuntu 11.04+. If the problem is the same in Windows or with another Os/Distro then this is not an Ubuntu problem so much as a network problem. Maybe your ISP, Router, ADSL connection, etc..
  • You installed the default Ubuntu using the LiveCD and not Wubi from inside Windows. There has been several cases where installing Ubuntu via Wubi somehow slowed the network speed. I can only confirm for myself 1 case but I have heard of several. So I will assume you have installed Ubuntu using the LiveCD (Does not matter if you are sharing the hard drive with another distro or with Windows, the important part here is installing Ubuntu using the LiveCD).
  • You have updated your Ubuntu version to the latest. I recommend activating the multiverse, universe and restricted repos and also activate the proposed and backports updates. All of which can be done using the software sources.
  • Optional - You have installed Ubuntu from Scratch and not updated from an older version. In the past i have trouble after upgrading from a previous one. Do not know right now but this is "just in case".
  • You have already rebooted the PC at least once after installing ALL the updates.
  • You do not have a Firewall that limits anything. Just in case you have a pro-windows firewall device.

So now we can begin...

In each case I will give an answer that works for some but not for others. If one works, do not test the rest. We will also open several files with the terminal tool NANO. After editing or changing anything with it, to exit and save just press CTRL+X and then press Y. That should quit nano and tell it to save the file.

The IPv6 Issue

There has been some issues with having IPv6 for some users. For this let us go step by step with this:

  1. Check to see if IPv6 is ENABLED - Type the following in a terminal: lsmod | grep ipv6. If you see anything mentioning IPv6, then you have it enabled. If not then you can proceed with the next issue mentioned.

  2. Disable IPv6 - There are several ways to accomplish this (Do only one):

    2.1 - Edit the file sudo nano /etc/sysctl.conf and add the following lines at the end of the file:

    net.ipv6.conf.all.accept_ra = 0
    net.ipv6.conf.all.disable_ipv6 = 1
    net.ipv6.conf.default.disable_ipv6 = 1
    net.ipv6.conf.lo.disable_ipv6 = 1

    Save and reboot.

    2.2 - Edit the file sudo nano /etc/default/grub and find the line that says GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" and add to it ipv6.disable=1.
    It should look like this afterwards: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash ipv6.disable=1". Save it and type sudo update-grub. After this reboot the PC.

    2.3 - Edit the file sudo nano /etc/modprobe.d/blacklist.conf and at the end add the line: blacklist ipv6. Save and reboot.

    2.4 - Via the GUI version of NetworkManager in the Upper Panel (The network icon that appears when you install Ubuntu in the upper right corner next to the volume icon) select the network icon and select Edit Settings. Select the network connection you are using and in the IPv6 Settings select Ignore. This option can be mixed with the 3 previous mentioned above.

Configuration Issue

  1. In some cases it may be some misconfiguration gone wild. Try this:

    1.1 - Type ifconfig and look for the txqueuelen option. Normally it says 1000. Lower it to 500, 200, 100 or 50 just to test if it gets better: sudo ifconfig eth0 txqueuelen 50. In this case we have set txqueuelen to 50. To go back to 1000 just change the 50 to 1000.

    1.2 - Edit the file /etc/sysctl.conf and add at the end: net.ipv4.tcp_window_scaling=0 to the file. Save and reboot.

Network Card Issues

In some cases the actual network card is the problem. Maybe a confusion between the drivers and the NIC or the actual NIC. In any case here are some examples depending on the network card:

1. Realtek 8166 - Slow wired internet connection on Realtek RTL8168-8111 (Rev 6)

2. Broadcom BCM5721 - Slow Internet connection with 11.04

3. e1000e 82579V - Ubuntu 11.04 and slow internet experience

Askubuntu Issues

If all else fails Askubuntu has an exaggerating amount of info about "Slow Internet". Mose cases are 11.04 and 11.10. All of which you can see here: https://askubuntu.com/search?q=slow+internet


I did more research and it's not necessary to disable ocsp in firefox.

here is how to do it:

  • In firefox browse to the address about:config.
  • Search for the key network.dns.ipv4OnlyDomains and double-click on it.
  • Then you need to put some servers to force a dns query over ipv4. Put all the servers from this up to date list.
  • Completely close all the browsers and reopen a new one.

Before you try all these complicated solutions that they are recommending, try this (it's easy because it involves the GUI and no commands).

  • Click on the symbol (icon) for your wireless connection
  • Click on the Wireless tab
  • Click on your current wireless connection
  • Click Edit
  • Click on IPV4 settings method drop down box: select automatic (DHCP) addresses only
  • then in the DNS servers field: type the IP Address of your wireless router or default gateway. Mine was 192.168.0.1 for example.

Hit Save. Disable your wireless hardware for a few seconds (my method is function key F2), turn it back on and test your browser's speed.

I figured out that there was nothing wrong with the wireless or the Internet itself because only browsers were slow at going to websites (Chrome, Firefox, etc). But when I tried my virtual box machines, they were lightening fast on the Internet.


This link was useful for me..

http://www.hitxp.com/articles/software/ubuntu-fix-slow-wireless-internet-connection-speed-upgrading-11-04-natty-narwhal/


Possibly that you have a tool called wondershaper that is currently configured to limit your ethernet interface bandwidth.


If this is the case, you can remove this limitation by executing sudo wondershaper clear <interface name> where interface name is something like eth0.