Network diagnostics for a dedicated server
If you encounter network problems, perform a diagnostic.After diagnostics, some common problems can be solved by yourself.
If the problem cannot be solved, create a ticket.In the ticket, specify the description of the problem and attach the results of diagnostics.The method of diagnostics depends on the problem you encountered.
Network problems and diagnostic methods
Perform route tracing
Perform route tracing if you encounter:
- with slow connection speeds;
- high network latency;
- by the loss of the connection;
- by packet loss during data transmission;
- inaccessibility of the server from a particular external network.
You need to trace in two directions - from the dedicated server to a point outside the Selectel infrastructure and back again.To do this, you need an external server - any server with a public IP address and Internet access that is outside the Selectel infrastructure.
We recommend performing tracing using the mtr utility (WinMTR for Windows).The utility allows you to trace the full path and time of the traffic and find out at what stage of the route delays or packet loss occur.
- Perform a trace from the dedicated server to the front-end server.
- Perform a trace from the external server to the dedicated server.
1. Perform a trace from the dedicated server to the front-end server
Linux
Windows
macOS
-
Install the
mtrutility on a dedicated server.Read more on GitHub mtr. -
Optional: prepare the dedicated server for tracing - shut down utilities and applications that may affect the trace result:
- firewall rules in the OS;
- application layer (L7, application layer) - web servers, mail servers, file servers, name servers, peer-to-peer network clients and servers, etc.
-
Perform a trace to the external server address:
mtr -b <remote_ip_address>Specify
<remote_ip_address>- The IP address of the external server. -
Wait for the utility to perform a trace and display route and delay information.
-
Stop the trace:
q
2. Perform a trace from the external server to the dedicated server
-
On the external server, install the utility depending on the OS you are using:
- for Linux is
mtr, more details on GitHub mtr; - for Windows -
WinMTR.
- for Linux is
-
Optional: prepare the front-end server for tracing - shut down utilities and applications that may affect the trace result:
- firewall rules in the OS;
- application layer (L7, application layer) - web servers, mail servers, file servers, name servers, peer-to-peer network clients and servers, etc.
-
Perform a trace to the address of the dedicated server.The IP address of the dedicated server can be viewed in the control panel: from the top menu, click Products → Dedicated Servers → Servers → Server → Server page → Operating System tab → IP field .
Measure the baud rate
If you are having problems with slow data transfer speeds, measure your connection speed.
Measure the data transfer rate in two directions - from a 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 outside the Selectel infrastructure.
We recommend using the iperf3 utility to measure speed.
1. Prepare a dedicated server for speed measurement
-
Boot the server in recovery and diagnostic mode To exclude the influence of OS processes on the diagnostic results.
-
Install the
iperf3utility on a dedicated server, see the iPerf documentation for details. -
Run the
iperf3utility.The utility should run until the baud rate measurement is complete.iperf3 -s
2. Measure the baud rate
-
On the external server, open the CLI.
-
Install the
iperf3utility on the external server, see the iPerf documentation for details. -
Measure the speed from the external server to the dedicated server.The command will perform the measurement in 20 threads to maximize the link load.
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 → Server page → Operating System tab → IP field . -
Perform the measurement in the opposite direction - add the
-Rkey 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 → Server page → Operating System tab → IP field .
Check the status of the network interfaces
Check the status of the network interfaces if the server does not have Internet access.
Linux
Windows
macOS
-
Check the status of the network interfaces:
ip aThe response will show information about the 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 foreverHere:
enp0s1- the name of the network interface on the local port;enp0s2- the name of the network interface on the Internet port;UP- status of the network interface.
-
If the network interface is in
DOWNstatus. enable it.For more information. in the IP Command Set documentation iproute2 instructions is a utility package that includes theiputility.ip link set dev <eth_name> upSpecify
<eth_name>is the name of the network interface you obtained in step 2.
Check the routing settings
Check the routing settings if:
- there is no internet access on the server;
- the server is unavailable on the network;
- server is unavailable from a specific external network.
Linux
Windows
macOS
-
Check the routing settings:
ip rA table of routes will appear in the response. 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 100Here:
-
default via 203.0.113.1 dev enp0s2- default route, traffic to the Internet goes through the gateway203.0.113.1on the interfaceenp0s2; -
203.0.113.0/24 dev enp0s2- route to public subnet203.0.113.0/24traffic to this subnet goes on the interfaceenp0s2; -
192.168.1.0/24 dev enp0s1- route to private subnet192.168.1.0/24, traffic to this subnet goes through the interfaceenp0s1.
-
Dump network traffic
If the server is inaccessible from a particular external network or you observe momentary connection losses, collect a dump of network traffic.
Network traffic dump is the process of recording and storing network traffic that passes through a network or device.A dump contains information about network protocols, packets transmitted, their contents, data sources and recipients.
Linux
Windows
macOS
-
Install
tcpdump, which is a utility for capturing and analyzing network traffic.See the tcpdump documentation for more information.apt updateapt install -y tcpdump -
Look for the name of the network interface for which you want to write a dump, for this purpose print the list of network interfaces:
ip aThe response will show information about the 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 foreverHere
enp0s2is the name of the network interface on the Internet port. -
Run
tcpdump:sudo tcpdump -i <eth_name> -w <file_name>Specify:
<eth_name>- the name of the network interface you got in step 3;<file_name>- the name of the file to which you want to write the network traffic capture, e.g.dump.pcap.
-
Wait until the right amount of data has been collected.
-
Stop the recording by pressing Ctrl + C.
Restart network services
Restart network services if on a server:
- no internet access;
- or the server is inaccessible from a specific external network.
Linux
Windows
macOS
-
Restart the network services:
systemctl restart networking
Check filtering rules
If the server is inaccessible over the network, check the firewall filtering rules in the server OS.
Linux
Windows
macOS
-
Look at the list of firewall rules:
iptables -L -n -vA list of rules will appear in the response. 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 destinationHere:
-
Chain- A list of rules for packets of a particular direction:INPUT- for incoming packets;FORWARD- for redirected packets;OUTPUT- for outgoing packets;
-
policy- the action of the rule, such asACCEPTorDROP.
-
Scan the 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.
Linux
Windows
macOS
-
Install
nmap, more details in the Linux Distributions article of the nmap documentation. -
Scan the ports:
nmap -p <port> <ip_address>Specify:
- optional:
<port>- ports in commas, such as22,80,443, or a range of ports, such as20-30; <ip_address>- The IP address of the dedicated server.The IP address of the dedicated server can be viewed in the control panel under Servers and equipment → Servers → server card → field IP address.
- optional:
Check node availability on the network and measure latency
If the server is unavailable over the network, experiencing high network latency or packet loss, check the availability of the server and measure the latency using the ping utility.The ping utility is part of the standard networking toolkit and is pre-installed in most operating systems.
The check can be performed up to the public or private IP address of the server, or a domain name that is bound to the server's IP address.
You will need a second server from which you will perform the check.If the check will be to a private IP address, the servers must be connected over a private network.
-
Open the CLI on the server from which you will perform the check.
-
Perform the test:
ping <ip_address>Specify
<ip_address>- IP address or domain name of the server.The IP address of the dedicated server can be viewed in the control panel: in the top menu, click Products → Dedicated Servers → Servers → Server page → Server page → Operating System tab → IP field .
Check access from the OS in recovery and diagnostic mode
So that OS settings do not affect server operation and diagnostics:
-
Connect to the server via SSH or via KVM console:
- If the server responds and you can connect, there is a software problem on the server. Reboot the server to restart the network services.If the problem is software, returning to the previous OS boot pattern will fix the problem;
- if the server in recovery and diagnostic mode is unavailable, create a ticket describing the problem.