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.
- Trace the route from the dedicated server to the external server.
- Trace the route from the external server to the dedicated server.
1. Trace the route from the dedicated server to the external server
Linux
Windows
macOS
-
Install the
mtrutility on the dedicated server. Learn more on GitHub mtr. -
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.
-
Trace the route to the external server address:
mtr -b <remote_ip_address>Specify
<remote_ip_address>— IP address of the external server. -
Wait for the utility to trace the route and output routing and latency information.
-
Stop tracing:
q
2. Trace the route from the external server to the dedicated server
-
Install a utility on the external server depending on the OS used:
- for Linux —
mtr, learn more on GitHub mtr; - for Windows —
WinMTR.
- for Linux —
-
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.
-
Trace the route to the dedicated server address. You can view the dedicated server IP address in the control panel: in the top menu, click Products → Dedicated Servers → Servers → 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
-
Boot the server into recovery and diagnostic mode to eliminate the influence of OS processes on diagnostic results.
-
Install the
iperf3utility on the dedicated server, learn more in the iPerf documentation. -
Launch the
iperf3utility. The utility must run until measuring the data transfer speed is complete.iperf3 -s
2. Measure data transfer speed
-
Open the CLI on the external server.
-
Install the
iperf3utility on the external server, learn more in the iPerf documentation. -
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 -i10Specify
<ip_address>— public IP address of the dedicated server. You can view it in the control panel: in the top menu, click Products → Dedicated Servers → Servers → server page → Operating System tab → IP. -
Measure the speed in the reverse direction — add the
-Rflag to the command:iperf3 -c <ip_address> -P20 -t60 -i10 -RSpecify
<ip_address>— public IP address of the dedicated server. You can view it in the control panel: in the top menu, click Products → Dedicated Servers → Servers → 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.
Linux
Windows
macOS
-
Check the status of network interfaces:
ip aThe response will contain information about network interfaces. For example:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group defaultlink/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope hostvalid_lft forever preferred_lft forever2: enp0s1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000link/ether 1c:1b:0d:12:34:56 brd ff:ff:ff:ff:ff:ffinet 192.168.1.100/24 brd 192.168.1.255 scope global dynamic enp0s1valid_lft 604675sec preferred_lft 604675secinet6 fe80::1234:abcd:5678:9ef0/64 scope linkvalid_lft forever preferred_lft forever3: enp0s2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000link/ether 1c:1b:0d:65:43:21 brd ff:ff:ff:ff:ff:ffinet 203.0.113.10/24 brd 203.0.113.255 scope global dynamic enp0s2valid_lft 604675sec preferred_lft 604675secinet6 fe80::abcd:1234:5678:9ef0/64 scope linkvalid_lft forever preferred_lft foreverWhere:
enp0s1— network interface name on the local port;enp0s2— network interface name on the internet port;UP— network interface status.
-
If the network interface is in the
DOWNstatus, enable it. Learn more in the IP Command Set guide of the iproute2 documentation — this is a utility package that includes theiputility.ip link set dev <eth_name> upSpecify
<eth_name>— 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.
Linux
Windows
macOS
-
Check routing settings:
ip rThe response will contain a routing table. For example:
default via 203.0.113.1 dev enp0s2 proto dhcp metric 100203.0.113.0/24 dev enp0s2 proto kernel scope link src 203.0.113.10 metric 100192.168.1.0/24 dev enp0s1 proto kernel scope link src 192.168.1.100 metric 100Where:
-
default via 203.0.113.1 dev enp0s2— default route, internet traffic goes via gateway203.0.113.1on interfaceenp0s2; -
203.0.113.0/24 dev enp0s2— route to public subnet203.0.113.0/24, traffic to this subnet goes on interfaceenp0s2; -
192.168.1.0/24 dev enp0s1— route to private subnet192.168.1.0/24, traffic to this subnet goes on interfaceenp0s1.
-
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.
Linux
Windows
macOS
-
Install
tcpdump— a utility for capturing and analyzing network traffic. Learn more in the tcpdump documentation.apt updateapt install -y tcpdump -
Find the name of the network interface for which you need to capture a dump by listing the network interfaces:
ip aThe response will contain information about network interfaces. For example:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group defaultlink/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope hostvalid_lft forever preferred_lft forever2: enp0s1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000link/ether 1c:1b:0d:12:34:56 brd ff:ff:ff:ff:ff:ffinet 192.168.1.100/24 brd 192.168.1.255 scope global dynamic enp0s31f6valid_lft 604675sec preferred_lft 604675secinet6 fe80::1234:abcd:5678:9ef0/64 scope linkvalid_lft forever preferred_lft forever3: enp0s2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000link/ether 1c:1b:0d:65:43:21 brd ff:ff:ff:ff:ff:ffinet 203.0.113.10/24 brd 203.0.113.255 scope global dynamic enp0s2valid_lft 604675sec preferred_lft 604675secinet6 fe80::abcd:1234:5678:9ef0/64 scope linkvalid_lft forever preferred_lft foreverWhere
enp0s2is the network interface name on the internet port. -
Run
tcpdump:sudo tcpdump -i <eth_name> -w <file_name>Specify:
<eth_name>— network interface name you obtained in step 3;<file_name>— name of the file to save the network traffic capture to, for exampledump.pcap.
-
Wait until the required amount of data is collected.
-
To stop recording, press 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.
Linux
Windows
macOS
-
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.
Linux
Windows
macOS
-
View the list of firewall rules:
iptables -L -n -vThe 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 destination2045 187K ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/01087 159K ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED120 8400 ACCEPT tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:220 0 DROP all -- * * 192.168.1.100 0.0.0.0/0Chain FORWARD (policy DROP 0 packets, 0 bytes)pkts bytes target prot opt in out source destinationChain OUTPUT (policy ACCEPT 3456 packets, 456789 bytes)pkts bytes target prot opt in out source destinationWhere:
-
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 exampleACCEPTorDROP.
-
Scan ports
If the server is unreachable over the network or unreachable from a specific external network, scan ports. Ports can be scanned using the nmap utility.
Linux
Windows
macOS
-
Install
nmap, learn more in the Linux Distributions article of the nmap documentation. -
Scan ports:
nmap -p <port> <ip_address>Specify:
- optional:
<port>— comma-separated ports, for example22,80,443, or a port range, for example20-30; <ip_address>— IP address of the dedicated server. You can view the dedicated server IP address in the control panel under Servers and Hardware → Servers → server card → IP address.
- optional:
Check host network availability and measure latency
If the server is unreachable over the network, experiencing high network latency or packet loss, check server availability and measure latency using the ping utility. The ping utility is part of the standard networking toolset and is pre-installed on most operating systems.
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.
-
Open the CLI on the server from which you will perform the check.
-
Run the check:
ping <ip_address>Specify
<ip_address>— IP address or domain name of the server. You can view the dedicated server IP address in the control panel: in the top menu, click Products → Dedicated Servers → Servers → 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:
-
Connect to the server via SSH or via KVM console:
- if the server responds and you can connect, the problem is with the software on the server. Reboot the server to restart network services. If the problem is software-related, it will be resolved when reverting to the previous OS boot template;
- if the server is unreachable in recovery and diagnostic mode, create a ticket describing the issue.