Valid for Cloud Servers, VPS, VPS+, Virtual Server Clouds, Dedicated Servers, and Value Servers which are managed in the Cloud Panel.

This article lists the most important commands that you need to check the network configuration.

These instructions have been validated and adapted for the following operating systems:

  • Ubuntu: Ubuntu 22.04 (with/without Netplan), Ubuntu 24.04
  • Debian: Debian 12 (with/without Netplan), Debian 13
  • Enterprise Linux: AlmaLinux 9 and 10, Rocky Linux 9 and 10

Perform port scan

To perform a port scan, you can use the netcat program. Netcat (nc) is a universal command line tool. It can be used in the terminal or in scripts for communication via TCP and UDP network connections (Internet Protocol version 4 and version 6).

The netcat program is part of every Ubuntu installation, but can be installed using the following commands if necessary:

Ubuntu 22.04, Ubuntu 24.04, Debian 12, and Debian 13

apt-get update && apt-get install netcat-openbsd

AlmaLinux 9, AlmaLinux 10, Rocky Linux 9, and Rocky Linux 10

dnf update && dnf install -y nc

To perform a port scan with netcat, enter the following command:

nc -v IP-ADDRESS-OF-SERVER PORTNUMBER

Example:

nc -v 192.168.1.1 22

Check network services

To view a list of listening network services, daemons and programs, enter the following command:

ss -tulpen

You can then check whether the relevant network services, daemons, and programs are active and listening on the correct port. After entering the command, you can also determine whether the required port needs to be enabled.

Check network configuration

To display the configured interfaces, enter the command ip addr. After entering the command, the status of each interface is displayed:

Example:

root@localhost:~# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:50:56:00:f1:5b brd ff:ff:ff:ff:ff:ff:ff
inet 217.160.173.123/32 brd 217.160.173.123 scope global ens192
valid_lft forever preferred_lft forever
inet6 fe80::250:56ff:fe00:f15b/64 scope link
valid_lft forever preferred_lft forever

Activate network interface

You can reactivate a deactivated interface with the following command:

Method 1: Universal (Temporary)

Works on all systems (Ubuntu, Debian, AlmaLinux, Rocky Linux), but may only last until the next reboot or service reload:

sudo ip link set NAME_OF_INTERFACE up

Example:

sudo ip link set ens192 up

Method 2: Distribution-specific (persistent)

Ubuntu 22.04 (without netplan), Debian 12 (without netplan)

sudo ifup NAME_OF_INTERFACE

Example:

sudo ifup ens192

If this command fails, it is possible that the interface is in a state that is unknown to the command script. In this case, enter the same command with the --force parameter:

sudo ifup --force NAME_OF_INTERFACE

Example:

sudo ifup --force ens192

AlmaLinux 9, AlmaLinux 10, Rocky Linux 9, Rocky Linux 10

sudo nmcli connection up NAME_OF_INTERFACE

Example:

sudo nmcli connection up eth0

Check and edit configuration files

If no connection is possible, the configuration files must be checked.

To do this, open the configuration files listed below with the vi editor. Check and edit the settings and then restart the network if necessary to apply the changes to the network configuration:

Ubuntu 22.04 (with Netplan), Ubuntu 24.04, Debian 12 with Netplan, and Debian 13

Here the files are in YAML format. Pay strict attention to the indentation!

Path: /etc/netplan/ (e.g. /etc/netplan/01-netcfg.yaml)

Ubuntu 22.04 (without Netplan) and Debian 12 (without Netplan)

The configuration is done via ifupdown.

Path: /etc/network/interfaces

AlmaLinux 9, AlmaLinux 10, Rocky Linux 9, and Rocky Linux 10

These systems use NetworkManager. The old ifcfg scripts are obsolete or are no longer supported. The configurations are now key files in INI format.

Path: /etc/NetworkManager/system-connections/NAME_OF_INTERFACE.nmconnection

Restart the network

To apply changes, execute the following commands. A complete server restart (reboot) always works, but is often not necessary.

Ubuntu 22.04 with Netplan, Ubuntu 24.04, Debian 12 with Netplan, and Debian 13

netplan apply

Ubuntu 22.04 without Netplan and Debian 12 without Netplan

systemctl restart networking

AlmaLinux 9, AlmaLinux 10, Rocky Linux 9, and Rocky Linux 10

systemctl restart NetworkManager

Display and configure IP routing table with route

You can use the route program to display and configure the IP routing table. To do this, enter the following command:

route