How often does Debian break unstable

How to Solve Linux Networking Problems

Thorsten Eggeling

Unfortunately, network problems can have a wide variety of causes. With systematic troubleshooting, you can isolate errors and then carry out repairs in the right place.

EnlargeIf the automatic setup doesn't work properly, you have to lend a hand to the network yourself.
© Helma Spona - Fotolia.com

When the network goes on strike, troubleshooting is not easy. It may be due to the DSL router, the cabling or the router's WLAN configuration. Drivers for the Ethernet or WLAN adapter may be missing or the adapter is simply defective or not configured correctly. Investigate the possible causes step by step and narrow down the problem to find a solution.

EnlargeThe network manager shows that there is a wired network connection.

1. Check the network adapter of the PC

Before you change anything in the configuration of the system, check the network adapter and its connection to the local network and the Internet. First check in the BIOS setup whether the network adapter is activated at all. You will usually find the settings under "Integrated Peripherals" or "Advanced". In notebooks, the WLAN adapter can often be switched off using a key combination or a switch on the device. Make sure the adapter is active.

Use a live system for testing. Via the icon of the network manager - for example in Ubuntu in the upper bar - you can determine whether an Ethernet connection is available, or you can establish a connection to the WLAN. In the live system, try out whether the web browser can load content from the Internet and whether the file manager can find shares in the local network. If the network manager does not display a "wired network connection" or WLANs, the necessary drivers are probably missing. The network will then not work even with an installed Linux system.

Drivers belong to the Linux kernel and it depends on the kernel version which hardware is supported. You will not receive any drivers from the hardware manufacturer that can simply be installed later.

EnlargeThe lshw tool outputs information on the detected network adapters and their names.

In the case of Ethernet adapters, the number of model variations and chipset manufacturers is manageable and the support for Linux is good. Problems with wired adapters are therefore very rare. You can find an overview of the network adapters supported at www.pcwelt.de/_bzZw8. It looks different with WLAN adapters. There are many different models and chipsets, and sometimes manufacturers change the hardware even though the device name remains the same. In addition to the driver, a firmware file is usually required, which must match the respective device exactly. This makes commissioning under Linux difficult.

The easiest way to solve the problem is to change the hardware. Gigabit Ethernet adapters for the PC are available for around ten euros. Mostly widespread chipsets that Linux support well can be found on inexpensive network adapters in particular. If in doubt, ask the seller about Linux support or check out the reviews at the online retailer.

You are also on the safe side with WLAN adapters if you find out whether the WLAN chip is supported by Linux before you buy it. You can get an overview with tips on devices and their commissioning at www.pcwelt.de/anr6. Further information on WLAN adapters can be found in the box "Activating the WLAN adapter via detours".

2. Check drivers and configuration

The quickest way to determine whether Linux has actually recognized the network adapter is to use the command line. Open a terminal and run the following command:

In the output you will see the device name after “Logical name:” - for example, “enp0s3” or “eth0” for a cable network connection. "Description:" stands for "Ethernet Interface". For WLAN adapters, the description is “wireless connection” and the name is “enx [ID]”, “wlan0” or “ra0”. After “Configuration:”, lshw also outputs the name of the driver used, its version and the current IPv4 address. With

display further information. The assigned IP address for IPv4 (“inet”) and IPv6 (“inet6”) is shown after the logical name. If, for example, "enp0s3" appears, but without an IP address, then only the connection to the router does not work. In this case, check the cabling. If, on the other hand, the IP address does not match the network (-> point 3), a second DHCP server is probably active. For other devices, such as additional routers or WLAN access points, check whether DHCP is also activated here. There can only ever be one DHCP server in a network.

If ifconfig only shows "lo" (loopback adapter), no driver for the network adapter is loaded. Get in a terminal window with

show the devices that are connected via the PCI bus. For USB devices, use

In the list that appears, look for lines that contain “Network controller” or “Ethernet controller”. If nothing can be seen, the adapter is either deactivated or defective. If the adapter appears, look for the USB or PCI ID on the Internet. lspci and lsusb output these in the form “Manufacturer ID: Device ID”, for example “10ec: 8168”. In this way you can determine which adapter it is exactly and what experiences other Linux users have had with it.

Reading tip:SSH remote maintenance for your Linux server

EnlargeThe tool ifconfig provides a quick overview. It shows the IPv4 and IPv6 addresses.

3. Test the connection to the router

From here we assume that the Ethernet or WLAN adapter works technically, but still no connection to the Internet or local network is possible. The most important device in the home network is the DSL router. It connects two networks - the Internet and your home network. The router usually also serves as a WLAN access point. In addition, a network switch is built in, which enables direct communication between the wired and wirelessly connected devices.

Another task of the router is the allocation and management of IP addresses via DHCP (Dynamic Host Configuration Protocol). For example, the router is configured with the IP address 192.168.0.1 and then assigns IP addresses from the range 192.168.0.2 to 192.168.0.254 to the devices.

It also transmits the network mask 255.255.255.0 and the addresses of the standard gateway and the DNS server. These are usually identical to the router's IP number. To find out what information your network adapter has received from the DHCP server, click the network manager icon and select “Connection Information” in the Ubuntu 16.04 menu or “Network Settings” in Linux Mint.

EnlargeUbuntu shows in the "connection information" all values ​​with which a network adapter was configured via DHCP.