Skip to main content

Network diagnostics for a dedicated server

If you encounter network problems, run diagnostics. After diagnostics, you will be able to resolve some common issues on your own.

If you cannot resolve the issue, create a ticket. In the ticket, describe the issue and attach the diagnostic results. The diagnostic method depends on the problem you encountered.

Network issues and diagnostic methods

Trace the route

Trace the route if you encounter:

  • low connection speed;
  • high network latency;
  • connection drops;
  • packet loss during data transfer;
  • server unreachability from a specific external network.

Route tracing must be performed in both directions — from the dedicated server to a point outside the Selectel infrastructure and back. To do this, you will need an external server — any server with a public IP address and internet access that is located outside the Selectel infrastructure.

We recommend running route tracing using the mtr utility (WinMTR for Windows). The utility allows you to track the full path and transit time of traffic and find out at what stage of the route delays or packet loss occur.

  1. Trace the route from the dedicated server to the external server.
  2. Trace the route from the external server to the dedicated server.

1. Trace the route from the dedicated server to the external server

  1. Connect to the server via SSH or via KVM console.

  2. Install the mtr utility on the dedicated server. Learn more on GitHub mtr.

  3. Optional: prepare the dedicated server for route tracing — disable tools and applications that may affect the tracing result:

    • OS firewall rules;
    • application layer (L7) applications — web servers, mail servers, file servers, name servers, peer-to-peer network clients and servers, etc.
  4. Trace the route to the external server address:

    mtr -b <remote_ip_address>

    Specify <remote_ip_address> — IP address of the external server.

  5. Wait for the utility to trace the route and output routing and latency information.

  6. Stop tracing:

    q

2. Trace the route from the external server to the dedicated server

  1. Install a utility on the external server depending on the OS used:

    • for Linux — mtr, learn more on mtr GitHub;
    • for Windows — WinMTR.
  2. Optional: prepare the external server for route tracing — disable tools and applications that may affect the tracing result:

    • OS firewall rules;
    • application layer (L7) applications — web servers, mail servers, file servers, name servers, peer-to-peer network clients and servers, etc.
  3. Run a traceroute to the address of the dedicated server. You can view the IP address of the dedicated server in the control panel: from the top menu, click ProductsDedicated ServersServers → server page → Operating System tab → IP.

Measure data transfer speed

If you encounter low data transfer speed issues, measure the connection speed.

Measure data transfer speed in two directions — from the dedicated server to a point outside the Selectel infrastructure and back. To do this, you will need an external server — any server with a public IP address and internet access that is located outside the Selectel infrastructure.

To measure speed, we recommend using the iperf3. utility.

  1. Prepare the dedicated server for speed measurement.
  2. Measure the data transfer speed.

1. Prepare the dedicated server for speed measurement

  1. Boot the server in rescue and diagnostics mode to eliminate the influence of OS processes on diagnostic results.

  2. Connect to the server via SSH or via the KVM console.

  3. Install the iperf3 utility on the dedicated server, learn more in the documentation for iPerf.

  4. Run the iperf3 utility. The utility must remain running until the completion of the data transfer speed measurement.

    iperf3 -s

2. Measure data transfer speed

  1. Open the CLI on the external server.

  2. Install the iperf3 utility on the external server, learn more in the documentation for iPerf.

  3. Measure the speed from the external server to the dedicated server. The command will perform the test in 20 threads to maximize the load on the communication channel.

    iperf3 -c <ip_address> -P20 -t60 -i10

    Specify <ip_address> — public IP address of the dedicated server. You can view it in the control panel: from the top menu, click ProductsDedicated ServersServers → server page → Operating System tab → IP.

  4. Perform the measurement in the reverse direction — add the flag -R: to the command:

    iperf3 -c <ip_address> -P20 -t60 -i10 -R

    Specify <ip_address> — public IP address of the dedicated server. You can view it in the control panel: from the top menu, click ProductsDedicated ServersServers → server page → Operating System tab → IP.

Check the status of network interfaces

Check the status of network interfaces if there is no internet access on the server.

  1. Connect to the server via SSH or via the KVM console.

  2. Check the status of network interfaces:

    ip a

    The response will contain information about network interfaces. For example:

    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
    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: enp0s1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 1c:1b:0d:12:34:56 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.100/24 brd 192.168.1.255 scope global dynamic enp0s1
    valid_lft 604675sec preferred_lft 604675sec
    inet6 fe80::1234:abcd:5678:9ef0/64 scope link
    valid_lft forever preferred_lft forever

    3: enp0s2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 1c:1b:0d:65:43:21 brd ff:ff:ff:ff:ff:ff
    inet 203.0.113.10/24 brd 203.0.113.255 scope global dynamic enp0s2
    valid_lft 604675sec preferred_lft 604675sec
    inet6 fe80::abcd:1234:5678:9ef0/64 scope link
    valid_lft forever preferred_lft forever

    Where:

    • enp0s1 — name of the network interface on the private port;
    • enp0s2 — name of the network interface on the internet port;
    • UP — status of the network interface.
  3. If the network interface is in the DOWN status, enable it. Learn more in the IP Command Set guide of the iproute2 documentation — a package of utilities that includes the utility ip.

    ip link set dev <eth_name> up

    Specify <eth_name> — the network interface name you obtained in step 2.

Check routing settings

Check routing settings if:

  • there is no internet access on the server;
  • the server is unreachable over the network;
  • the server is unreachable from a specific external network.
  1. Connect to the server via SSH or via the KVM console.

  2. Check routing settings:

    ip r

    The response will contain a routing table. For example:

    default via 203.0.113.1 dev enp0s2 proto dhcp metric 100
    203.0.113.0/24 dev enp0s2 proto kernel scope link src 203.0.113.10 metric 100
    192.168.1.0/24 dev enp0s1 proto kernel scope link src 192.168.1.100 metric 100

    Where:

    • default via 203.0.113.1 dev enp0s2 — default route, internet traffic goes through the gateway 203.0.113.1 via interface enp0s2;

    • 203.0.113.0/24 dev enp0s2 — route to the public subnet 203.0.113.0/24, traffic to this subnet goes via interface enp0s2;

    • 192.168.1.0/24 dev enp0s1 — route to the private subnet 192.168.1.0/24, traffic to this subnet goes via interface enp0s1.

Capture a network traffic dump

If the server is unreachable from a specific external network or you observe short-term connection losses, capture a network traffic dump.

A network traffic dump is the process of recording and saving network traffic that passes through a network or device. The dump contains information about network protocols, transmitted packets, their content, sources, and destinations of data.

  1. Connect to the server via SSH or via the KVM console.

  2. Install tcpdump — a utility for capturing and analyzing network traffic. Learn more in the documentation for tcpdump.

    apt update
    apt install -y tcpdump
  3. Find the name of the network interface for which you need to capture a dump by listing the network interfaces:

    ip a

    The response will contain information about network interfaces. For example:

    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
    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: enp0s1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 1c:1b:0d:12:34:56 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.100/24 brd 192.168.1.255 scope global dynamic enp0s31f6
    valid_lft 604675sec preferred_lft 604675sec
    inet6 fe80::1234:abcd:5678:9ef0/64 scope link
    valid_lft forever preferred_lft forever

    3: enp0s2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 1c:1b:0d:65:43:21 brd ff:ff:ff:ff:ff:ff
    inet 203.0.113.10/24 brd 203.0.113.255 scope global dynamic enp0s2
    valid_lft 604675sec preferred_lft 604675sec
    inet6 fe80::abcd:1234:5678:9ef0/64 scope link
    valid_lft forever preferred_lft forever

    Here enp0s2 is the name of the network interface on the internet port.

  4. Run tcpdump:

    sudo tcpdump -i <eth_name> -w <file_name>

    Specify:

    • <eth_name> — the network interface name you obtained in step 3;
    • <file_name> — the name of the file to save the network traffic capture to, for example dump.pcap.
  5. Wait until the required amount of data is collected.

  6. Stop recording by pressing Ctrl + C.

Restart network services

Restart network services if on the server:

  • there is no internet access;
  • or the server is unreachable from a specific external network.
  1. Connect to the server via SSH or via the KVM console.

  2. Restart network services:

    systemctl restart networking

Check filtering rules

If the server is unreachable over the network, check the firewall filtering rules in the server OS.

  1. Connect to the server via SSH or via the KVM console.

  2. View the list of firewall rules:

    iptables -L -n -v

    The response will contain a list of rules. For example:

    Chain INPUT (policy DROP 1234 packets, 98765 bytes)
    pkts bytes target prot opt in out source destination
    2045 187K ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
    1087 159K ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
    120 8400 ACCEPT tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
    0 0 DROP all -- * * 192.168.1.100 0.0.0.0/0

    Chain FORWARD (policy DROP 0 packets, 0 bytes)
    pkts bytes target prot opt in out source destination

    Chain OUTPUT (policy ACCEPT 3456 packets, 456789 bytes)
    pkts bytes target prot opt in out source destination

    Where:

    • Chain — list of rules for packets of a specific direction:

      • INPUT — for incoming packets;
      • FORWARD — for forwarded packets;
      • OUTPUT — for outgoing packets;
    • policy — rule action, for example ACCEPT or DROP.

Scan ports

If the server is unreachable over the network or unreachable from a specific external network, scan the ports. Ports can be scanned using the nmap. utility.

  1. Connect to the server via SSH or via the KVM console.

  2. Install nmap, learn more in the Linux Distributions section of the nmap documentation.

  3. Scan ports:

    nmap -p <port> <ip_address>

    Specify:

    • optional: <port> — comma-separated ports, for example 22,80,443, or a port range, for example 20-30;
    • <ip_address> — IP address of the dedicated server. You can view the IP address of the dedicated server in the control panel under Servers and HardwareServers → server card → IP address.

Check host network availability and measure latency

If the server is unreachable over the network, or if you experience high network latency or packet loss, check the server availability and measure latency using the ping utility. The ping utility is part of the standard networking toolset and is pre-installed in most OSs.

You can perform the check to the server's public or private IP address, or to the domain name linked to the server's IP address.

To perform the check, you will need a second server from which you will run the check. If the check is to a private IP address, the servers must be connected via a private network.

  1. Open the CLI on the server from which you will perform the check.

  2. Run the check:

    ping <ip_address>

    Specify <ip_address> — IP address or domain name of the server. You can view the IP address of the dedicated server in the control panel: from the top menu, click ProductsDedicated ServersServers → server page → Operating System tab → IP.

Check access from the OS in recovery and diagnostic mode

To prevent OS settings from affecting server operation and diagnostics:

  1. Boot the server in rescue and diagnostics mode.

  2. Connect to the server via SSH or via the KVM console:

    • if the server responds and you can connect, the issue is with the software on the server. Reboot the server to restart network services. If it is a software issue, it will be resolved when reverting to the previous OS boot template;
    • if the server is unreachable in rescue and diagnostics mode, submit a ticket describing the issue.