Master Network Connectivity Checks: From ethtool to nmap
This guide explains how to verify physical links, test ping latency, trace routes, check HTTP/HTTPS availability with wget and curl, assess TCP/UDP ports using netcat, telnet, and nmap, inspect local connections via netstat/ss, understand TCP states, and validate DNS resolution, providing practical command examples for each step.
Physical Connection Check
ethtool
Use
ethtool <device_name>to view the physical link status of a network interface. The Link detected field shows yes when the connection is healthy.
Network Connectivity Check
ping
Ping tests reachability between hosts and reports fields such as icmp_seq (packet number), ttl (time‑to‑live), time (round‑trip latency), rtt , min , avg , max , and mdev (standard deviation). Use
-I <interface>on Linux or
-S <source_address>on Windows to specify the sending interface.
tracepath
Similar to
traceroute,
tracepathshows each hop a packet traverses. It is simpler and produces concise output.
Example:
<code>tracepath -n 192.168.1.241</code>HTTP/HTTPS Connectivity Check
wget
Use
wget --spider -S <url>to test a URL without downloading content and to display response headers.
curl
Use
curl -I <url>to fetch only HTTP headers. Adding
-fmakes curl fail silently on HTTP errors.
TCP/UDP Connectivity Check
nc (Netcat)
Check TCP ports with
nc -zv <remote_host> <port>. Use
-ufor UDP and
-zto scan without sending data.
<code>nc -zv remote_host port</code>For UDP, send a test payload:
<code>echo test | nc -uv remote_host port</code>telnet
Simple TCP port check:
<code>telnet remote_host port</code>nmap
Use
nmap <target_ip>to scan common ports. Specify ports with
-p, e.g.,
nmap -p 80,443 remote_host. The state open means a service is listening, closed means no listener, and filtered indicates a firewall blocked the probe. ACK scans (
-sA) reveal firewall presence.
<code>nmap 192.168.0.104</code>Local Network Connection Inspection
netstat and ss
Both commands display active connections and listening sockets. Common options:
-a: show all sockets
-t: TCP only
-u: UDP only
-n: numeric addresses
-l: listening sockets
-p: show owning process
Examples:
<code>netstat -a</code> <code>netstat -tn</code> <code>netstat -un</code> <code>netstat -tulnp</code>The
sscommand uses the same options.
TCP Connection States
LISTEN – service waiting for connections
ESTABLISHED – successful three‑way handshake
SYN_SENT / SYN_RECV – intermediate handshake states
FIN_WAIT_1, FIN_WAIT_2, TIME_WAIT, CLOSE_WAIT, LAST_ACK, CLOSED – termination phases
Three‑Way Handshake Process
1. SYN : client sends a SYN with its initial sequence number. 2. SYN+ACK : server replies with its own sequence number and acknowledges the client. 3. ACK : client acknowledges the server, and the connection enters ESTABLISHED state.
DNS Availability Check
Use dig , host , or nslookup to verify DNS resolution. Example:
<code>dig www.baidu.com</code>Query a specific DNS server:
<code>dig www.baidu.com @180.76.76.76</code>Raymond Ops
Linux ops automation, cloud-native, Kubernetes, SRE, DevOps, Python, Golang and related tech discussions.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.