Networking

How to Solve Internet Problems on Linux

You probably heard from many Linux users on how great the Linux operating system is. How it gives you freedom and lets you do stuff that you’d never even dream on doing on windows. After finally deciding to change platforms. You install a Linux distro. At this point, your expectations are very high, and these expectations come plummeting down the hill, just like the last season of Game of Thrones, when you first start to use it.

Especially when you are new to Linux, things can get quite frustrating if you are not yet comfortable in the Linux environment. How you install software and apps, how you navigate is all different from Windows or MacOS.  The most frustrating problems can be internet connectivity problems. In this guide, I will be addressing such common issues. This will help you when you have internet connectivity problems on Linux and just want to get online quicky.

Ubuntu distro:

Linux has a wide range of distros, and it can be a little frustrating to decide which distro to choose. I will be using Ubuntu 18.4 LTS version as it’s by far the most popular and most used distro. Terminal commands may vary for various distros, so in case if a specific command doesn’t work, make sure it’s the correct command for your distro. To check what version of Linux you are on, type the following command in the terminal.

$ uname –a

The above command will display the following screen

Some little pre-checks:

Before we move forward with our diagnosis, make sure your network isn’t the one with the problem, i.e., make sure your network has internet access. If you are connected through a cable, make sure the cable is connected correctly.  Laptops have keys that turn wifi on and off. Make sure your wifi is turned on. You can also turn wifi on from Linux settings, as explained in the next part.

No Internet Connection

Most of the time, the wifi switch is turned off, and as a result, no internet connection as displayed. To fix this, go to settings, for this click on the down arrow next to the battery icon on the top right of your screen. In the dropdown, click on the screwdriver icon next to the button with a lock icon.

In the wifi tab, make sure you turn on the wifi switch. Also, make sure the airplane mode is turned off.

If your Linux still isn’t catching wifi signals, make sure your interfaces are up and running. To check whether your interfaces are up, type the following command in terminal

$ ip link

Now you will see the following screen.

In the above figure in the enp0s3 section, you should find “LOWER_UP.” This means your interface is up

Next, you’d want to check your IP and make sure its configured. For this type the following command in the Linux terminal

$ ip addr

Your terminal will look like this.

Your ip will be displayed after “innet.” If this is not the case, your IP is not correctly configured.

Check your Drivers

In most cases, the network drivers are not installed or not correctly installed, or your drivers are not up to date.  If your hardware is working correctly, this might be the case. Click on the shell button in the right bottom and type “software and updates” in the search bar. Open the software and update the app.

Go to the “Additional Drivers” tab. At this point, either connect an external device like a USB having the setup of the required network drivers or connect your Linux with the internet via Ethernet so that Linux can search the required drivers from the internet or your device. The available drivers will be shown here. Install the appropriate drivers from here. If no drivers are displayed here, this means no drivers are available on Linux for your hardware. In other words, Linux doesn’t support your equipment. But this is an extreme case, and it rarely happens. To check more information about your hardware, and what chipset do you have, type the following command in the terminal

$ lspci

Following will be the output

As my system is currently connected via Ethernet, Linux shows what ethernet hardware do I have. This is a useful command as it gives you all the information on once screen. You can google your chipset name and add the word Linux in front, doing this will show you whether Linux supports your particular hardware or not.

Some Diagnosing Tools

Linux includes some commands that can help you with the diagnosis of your Internet problem. One such command is following

$ ping –c5 google.com

What this will do is that it will make five connections with the site mentioned after the c5 part, google.com in this case, and will show the details like ping and packet loss of that connection each time. The 5 in “c5.” Part indicates the specifies of times  Linux makes the connection with that site. In the end, it also gives you a summary of all the connections, the minimum time, the maximum time, and the average.

With the help of this command, you can determine whether the problem is with your laptop or the site that you’re trying to access or with your Internet Service Provider.

Conclusion

Most of the connectivity problems are just because of wifi switch turned off, or sometimes the airplane mode is on. Here I have mentioned some solutions that you can go through, and hopefully, your problem will be solved. The most important part of this is that you update your drivers as that is the second most common reason that causes the connectivity problem. Updating drivers can be a bit tricky in Linux as the procedure is a lot different than the Windows procedure. But the drivers for network chipsets are proprietary and can be easily installed from the “Software and Updates app.”

About the author

Zeeman Memon

Zeeman Memon

Zeeman is a freelance content marketer, software engineer and tech blogger who loves to blog on his tech blog in his free time.