Network
-
Network diagnostics
A ladder of connectivity checks — from the gateway to DNS and the destination port.
5 minping -c4mtr -rwctraceroute -T -
ping — check whether packets reach a host
The ping command sends ICMP echo requests to a host and prints replies, latency and loss — the first network check.
6 minping -cpingip netns -
ip — addresses, interfaces and routes
Manage interfaces, addresses and routes (iproute2) — the replacement for ifconfig/route.
6 minip -brip rip route -
The veth pair and network namespaces
A veth pair is two virtual interfaces joined like a cable; it connects network namespaces inside one machine.
5 minip netnsip linkip -n -
Persistent networking with netplan
Persistent network configuration on Ubuntu — netplan YAML files, static addresses and DHCP, applying safely.
6 minnetplan generatenetplan trynetplan apply -
ss — sockets and ports
Shows who is listening on ports and which connections are open; a netstat replacement, faster with many connections.
4 minss -tlnpss -tnpss -tulnp -
sysctl — kernel parameters at runtime
sysctl reads and changes kernel parameters; -w lasts until reboot, a file in /etc/sysctl.d/ makes it permanent.
9 minsysctlsysctl -nsysctl -w -
lsof — open files and ports of processes
lsof shows which process holds a file, a port, or a deleted file that is still open.
6 minlsof -ilsoflsof -p -
nginx — web server and reverse proxy
nginx serves sites from disk and forwards requests to applications; it picks a site by Host, nginx -t checks the config.
13 minnginx -tsystemctl reloadnginx -T -
rsyslog — system logs
Writes text logs to /var/log and forwards them over the network; it does not rotate them itself, that's logrotate's job.
4 mintail -frsyslogd -N1logger -p -
Firewall — nftables / ufw
The Linux firewall: filtering traffic with simple ufw and low-level nftables, checking the rules.
6 minufw allowufw statusufw default -
Unix sockets — processes talking through a file
A unix socket is a file through which processes on one machine exchange data; connecting needs write permission on it.
9 minls -lstat -css -xl -
The classic iptables firewall
The classic Linux firewall — chains, rules, NAT, and why nftables replaced it.
5 miniptables -Liptables -Aiptables -I -
ssh, scp — connecting and copying over SSH
A client for logging in and copying files over SSH; host aliases in ~/.ssh/config remove repeated connection parameters.
3 minsshssh -pscp file -
sshd — the SSH server
The OpenSSH server; edit the config with a second session open — a mistake in PermitRootLogin locks you out immediately.
5 minsshd -tsshd -Tsystemctl reload -
SSH keys and ssh-agent
Key pairs for passwordless login; sshd rejects ~/.ssh if it is writable by the group or by others.
5 minssh-keygen -tssh-copy-idssh-keygen -l -
VLANs and interface bonding
Logical networks over a cable and combining NICs into one interface; the bond mode must match the switch's config.
4 minip -brcatip -d -
NFS network filesystem
Network directories over NFS — exporting on the server, mounting on the client, permissions.
4 minexportfs -raexportfs -vshowmount -e -
ssh-keyscan — collecting host keys
Pre-populate known_hosts with server keys — skip the interactive "yes" on first ssh.
5 minssh-keyscanssh-keyscan -Hssh-keyscan -t -
DNS and name resolution
How a name becomes an IP — resolv.conf, systemd-resolved, /etc/hosts, dig.
5 mingetent hostsresolvectl statusdig -
PostgreSQL — access, pg_hba.conf, dump and restore
PostgreSQL is a relational DBMS: roles and databases, pg_hba.conf access rules, pg_dump dumps and pg_restore restores.
14 minsystemctl startpg_lsclusterspsql -h -
nmap: which ports are visible from outside
A port scanner: shows which ports of a machine are open, closed or filtered, as another machine sees them.
8 minnmapnmap -pnmap -p- -
rsync — file synchronization and copying
Copies only the differences between trees; --delete mirrors the source into the destination, removing anything extra.
4 minrsync -avzPrsync -avznrsync -avz -
HTTP — requests, responses, status codes and headers
HTTP is the web protocol: a client sends a method, path and headers; the server replies with a code, headers, body.
11 mincurl -icurl -Icurl -v -
curl — HTTP requests from the console
curl sends HTTP and HTTPS requests from the console: status code, headers, the whole exchange, certificate checks.
7 mincurl -icurl -Icurl -v -
wget — downloading files over the network
Downloads files with resume and recursion; -r without -np and -l has no brakes and can mirror a whole site.
4 minwgetwget -Owget -c -
tcpdump — capturing and analyzing network traffic
Captures packets to diagnose "is traffic even arriving"; without -n it resolves every IP through DNS and slows down.
4 mintcpdump -ni -
ethtool — network card settings
Link speed and duplex, error statistics, cable type — NIC diagnostics.
4 minethtoolethtool -Sethtool -i -
Docker — containers: running, ports, volumes, networks
Docker runs programs in isolated containers started from images and manages their ports, volumes and networks.
23 minsystemctl enabledocker rundocker ps -
nc — checking ports and transferring data
Checking whether ports are reachable, simple data transfer over TCP/UDP.
4 minnc -zvw3nc -zvunc -zv -
docker compose — a container stack in one file
docker compose describes a container stack with network, volumes and variables in compose.yaml and starts it at once.
14 mindocker compose -
whois — domain and IP data
Shows a domain's or IP's owner and abuse contact; for domains, some fields are hidden by the registrar's privacy shield.
4 minwhoiswhois -h -
TLS and certificates — openssl, the chain, verification
A TLS certificate binds a server key to a site name; openssl reads its fields, checks the chain and issues a new one.
11 minopensslopenssl verifycurl --cacert -
conntrack — connection tracking
The kernel's connection table — what NAT/firewall see, overflow, debugging.
4 minconntrack -Lconntrack -Econntrack -S -
chrony: time synchronization over NTP
An NTP client and server: keeps the system clock in step with time servers and can serve time to your machines.
13 minchronyc trackingchronyc sourceschronyc sourcestats -
Prometheus — metrics collection
Collecting metrics with a pull model — targets, PromQL, exporters, alerts.
3 minpromtool checkcurl -
WireGuard — VPN on keys
A fast VPN on a key pair instead of passwords; the private key in wg0.conf needs permissions, like an SSH key.
4 minwg genkeywg-quick upwg show -
Samba — file sharing over SMB
An SMB server for Windows-compatible shares; the SMB password is separate from the system one, easy to forget to set.
5 minsmbpasswd -atestparmsmbstatus -
KVM and libvirt
Virtual machines on Linux — managed with virsh, networks, storage, console.
4 minvirsh listvirsh startvirsh shutdown -
Postfix — a mail server
Sending and receiving mail — config, the queue, logs, typical delivery debugging.
4 minpostconf -nmailqpostqueue -f -
BIND9 — DNS server
Running your own DNS — zones, records, config checks, resolving debug.
3 minnamed-checkconfnamed-checkzonerndc reload -
DHCP server
Handing out addresses on a network — pool, reservations, leases, diagnostics.
3 mindhcpd -tcatjournalctl -u -
HAProxy — load balancer
Load balancing and proxying TCP/HTTP — backends, health checks, statistics.
4 minhaproxy -csystemctl reloadecho -
keepalived — high availability with VRRP
High availability through a virtual IP — failover between nodes using VRRP.
4 minip ajournalctl -u