This appendix contains a summary of common network commands, a CIDR cheat sheet, and a list of common port numbers.
Common Commands Summary
| Command | Description |
|---|
ping | Test reachability of a host |
traceroute | Trace the path to a host |
ip addr show | Display IP addresses and network interfaces |
ip route show | Display the routing table |
ss -tl | List all listening TCP sockets |
netstat -tuln | List all listening ports |
dig | Query DNS servers |
nslookup | Query DNS servers |
nmap | Network scanning and security auditing |
curl | Transfer data from or to a server |
tcpdump | Packet analyzer |
tshark | Command-line version of Wireshark |
iftop | Display bandwidth usage |
nload | Monitor network traffic |
vnstat | Network traffic monitor |
CIDR Cheat Sheet
| CIDR | Subnet Mask | # of Addresses |
|---|
| /32 | 255.255.255.255 | 1 |
| /31 | 255.255.255.254 | 2 |
| /30 | 255.255.255.252 | 4 |
| /29 | 255.255.255.248 | 8 |
| /28 | 255.255.255.240 | 16 |
| /27 | 255.255.255.224 | 32 |
| /26 | 255.255.255.192 | 64 |
| /25 | 255.255.255.128 | 128 |
| /24 | 255.255.255.0 | 256 |
| /23 | 255.255.254.0 | 512 |
| /22 | 255.255.252.0 | 1,024 |
| /21 | 255.255.248.0 | 2,048 |
| /20 | 255.255.240.0 | 4,096 |
| /16 | 255.255.0.0 | 65,536 |
| /8 | 255.0.0.0 | 16,777,216 |
Common Port Numbers
| Port | Protocol | Service |
|---|
| 20 | TCP | FTP (Data) |
| 21 | TCP | FTP (Control) |
| 22 | TCP | SSH |
| 23 | TCP | Telnet |
| 25 | TCP | SMTP |
| 53 | TCP/UDP | DNS |
| 67/68 | UDP | DHCP |
| 80 | TCP | HTTP |
| 110 | TCP | POP3 |
| 123 | UDP | NTP |
| 143 | TCP | IMAP |
| 161/162 | UDP | SNMP |
| 443 | TCP | HTTPS |
| 3306 | TCP | MySQL/MariaDB |
| 5432 | TCP | PostgreSQL |
| 27017 | TCP | MongoDB |
| 1433 | TCP | MSSQL |