CLI Networking Commands
The command-line tools network engineers, sysadmins, and power users rely on to diagnose connections, query DNS, scan ports, capture packets, and measure throughput. Start with a speed test to establish your baseline — then dig deeper with these tools.
Connectivity and Diagnostics
The ping Command
Test reachability, measure round-trip time, and detect packet loss with the most fundamental network tool.
traceroute / tracert
Map every router hop between you and a destination and find where latency or loss enters the path.
The pathping Command
Windows packet-loss testing by hop, combining ping and traceroute in one built-in tool.
The tracepath Command
Linux route and path MTU clues without root privileges.
The mtr Command
Combines traceroute and ping into a live display — the best tool for diagnosing intermittent packet loss.
The iperf3 Command
Measure actual TCP or UDP throughput between two hosts — the right way to benchmark a link.
DNS Lookup Tools
Network Interfaces and Routing
ipconfig and ifconfig
Display and manage network interfaces — the essential first stop when diagnosing a connection problem.
The ip Command (Linux)
The modern Linux tool for managing addresses, routes, and interfaces — replacing ifconfig and route.
The route Command
View and modify your system's routing table to control where traffic is sent.
The arp Command
View and manage the ARP cache that maps IP addresses to MAC addresses on your local network.
Connections and Port Scanning
The netstat Command
List active connections, listening ports, and per-protocol statistics — available on every OS.
The ss Command
The faster, more detailed replacement for netstat on modern Linux systems.
The netcat Command
Test TCP and UDP ports, create temporary listeners, and prove firewall reachability.
The ssh Command
Connect securely to remote shells, use key authentication, forward ports, and troubleshoot common SSH failures.
Telnet Port Testing
The old TCP connection trick that still helps when you need a quick port check.
The netsh Command
Windows network reset, WLAN, IP, Winsock, and firewall diagnostics from Command Prompt.
networksetup on macOS
Manage DNS, Wi-Fi, proxies, and service order from Terminal.
The nmap Command
Discover hosts and open ports on a network — the standard tool for network inventory and security audits.
Packet Inspection and HTTP
The tcpdump Command
Capture and inspect live network traffic from the command line — essential for deep protocol debugging.
Wireshark Basics
Capture packets without drowning in them: filters, retransmits, DNS, TCP, and privacy warnings.
The curl Command
Make HTTP requests, test APIs, download files, and inspect headers directly from the terminal.
The wget Command
Download, resume, test headers, and check URLs from the terminal.
The whois Command
Look up domain registration details, IP ownership, and ASN information in one command.