Linux Network Services

Internet and Network Services in Linux Explained

A practical guide to network services in Linux: what they are, how they are configured, how to list and restart them, and the basic tools to check them.

On this page
  1. What a network service is
  2. How Linux configures networking
  3. Checking which services are running
  4. Restarting network services
  5. Commands for everyday checks
  6. The layers behind network services
  7. Monitoring and choosing tools
  8. Legacy services you may still meet
  9. Keep exposed services to a minimum
  10. Where to go next

Network services in Linux are the background programs that handle network work, either for your own machine or for the machines that connect to it. Some help your computer get online, such as the DHCP client that requests an IP address. Others answer requests from other computers, such as an SSH server or a web server. This guide explains what these services are, how Linux usually configures them, and the basic commands for checking and restarting them.

What a network service is

In Linux, a service is usually a long-running background process, often called a daemon. On most mainstream distributions, systemd starts these processes at boot, keeps track of them, and restarts them when asked.

Network services fall into two rough groups:

  • Client-side helpers support your own connections. Examples include DHCP clients, DNS resolvers, time sync clients, and the network managers that bring interfaces up.
  • Server-side services accept connections from other machines. Examples include SSH (sshd), web servers such as nginx or Apache, file sharing with Samba or NFS, and DNS or mail servers.

A single machine often runs both kinds at once.

How Linux configures networking

Linux does not use one fixed networking setup. The tool that configures your network interfaces depends on your distribution and how you installed it. Common options include:

  • NetworkManager, common on desktops and laptops, usually managed with nmcli or a graphical tool.
  • systemd-networkd, often used on servers and minimal installs.
  • Netplan, used on Ubuntu. You write YAML files in /etc/netplan/, and Netplan passes them to a backend such as systemd-networkd or NetworkManager.
  • ifupdown, which reads /etc/network/interfaces on some Debian-style systems.

To see which of the systemd-based options is active, run:

systemctl is-active NetworkManager systemd-networkd

An active result means that service is running. If neither is active, check your distribution’s documentation to find the tool it uses.

For viewing and changing the live network state, the ip command from the iproute2 package is the usual choice. The older ifconfig and netstat commands come from the net-tools package, which many current distributions no longer install by default.

Checking which services are running

To list running services on a systemd system:

systemctl list-units --type=service --state=running

To see which programs are listening on network ports, use ss:

sudo ss -tulpn

The flags show TCP (-t) and UDP (-u) sockets, only listening sockets (-l), the owning process (-p), and numeric addresses and ports (-n). For a fuller walk-through, read the article on how can I get a list of all running services in Linux.

Restarting network services

When a connection misbehaves, restarting the right service is often the quickest fix. The correct service depends on what manages your network, so identify that first. A restart over a remote session can disconnect you, so make sure you have console access before you start. The guide on how to restart network services in Linux covers each tool and its command.

Commands for everyday checks

Most first checks use a handful of commands: ping for reachability, ip for addresses and routes, ss for ports, and dig for DNS. The article on what are 10 common network commands lists ten of them with examples and gives the Windows equivalents.

The layers behind network services

Network services depend on the lower layers of the network working. The OSI model describes seven layers, and the first four cover cabling, frames, IP addressing and routing, and ports. Knowing where each one sits helps you judge where a fault most likely is. The article on what is L1, L2, L3, and L4 in networking walks through them in plain language.

Monitoring and choosing tools

Once services are running, you want to know when they stop answering. Monitoring tools such as Nagios and Zabbix can check whether a service responds and send an alert when it does not. The right choice depends on how many hosts you run and how much setup you want to do. For a comparison of options, see what are the best networking tools for linux. Routine checks like these also appear on any network administrator task list.

Legacy services you may still meet

Older networks sometimes use NIS, the Network Information System. NIS shared user and host lookup tables across machines. It is considered legacy today, and newer setups usually rely on LDAP, Kerberos, or another central identity service. If older documentation covers the network information system in Linux, treat it as background reading rather than a model to copy.

Keep exposed services to a minimum

Every listening port is a possible way in, so run only the services you need. Check what is listening with ss, turn off what you do not use, and use a firewall. Ubuntu offers ufw, and many Red Hat-based systems use firewalld. Keep the software updated as well.

Where to go next

Try the commands above on a test machine first. Once you are comfortable, read the articles on listing services, restarting them, and the networking layers. Verify each change after you make it, and keep a note of what you changed so you can undo it.

Keep exploring

Guides from other topics

All topics →