Appendices
BQuick Reference Cards
On this page
- Subnetting cheat sheet
- Private and special IPv4 addresses
- Common port numbers
- Which key for which job
- Troubleshooting order
- Everyday commands
Subnetting cheat sheet
| Prefix | Mask | Block size | Usable hosts |
|---|
| /8 | 255.0.0.0 | - | 16,777,214 |
| /16 | 255.255.0.0 | - | 65,534 |
| /23 | 255.255.254.0 | 2 (third octet) | 510 |
| /24 | 255.255.255.0 | 1 (third octet) | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
Formulas: usable hosts = 2^h − 2 · subnets = 2^s · block size = 256 − mask octet. Powers of two: 1, 2, 4, 8, 16, 32, 64, 128, 256.
Private and special IPv4 addresses
| Range | Use |
|---|
| 10.0.0.0/8 | Private (RFC 1918) |
| 172.16.0.0/12 | Private (172.16.0.0 to 172.31.255.255) |
| 192.168.0.0/16 | Private |
| 127.0.0.0/8 | Loopback (127.0.0.1) |
| 169.254.0.0/16 | APIPA: DHCP failed |
| 224.0.0.0/4 | Multicast |
Common port numbers
| Port | Service | Port | Service |
|---|
| 20/21 | FTP | 143 | IMAP |
| 22 | SSH, SFTP, SCP | 161 | SNMP (UDP) |
| 23 | Telnet (insecure) | 389 / 636 | LDAP / LDAPS |
| 25 / 587 | SMTP | 443 | HTTPS |
| 53 | DNS (UDP, TCP) | 445 | SMB |
| 67/68 | DHCP (UDP) | 3306 | MySQL |
| 80 | HTTP | 3389 | RDP |
| 110 | POP3 | 51820 | WireGuard (UDP) |
Which key for which job
| Task | Key used |
|---|
| Encrypt for secrecy | receiver's public key |
| Decrypt | receiver's private key |
| Sign | sender's private key |
| Verify a signature | sender's public key |
Troubleshooting order
1ping 127.0.0.1→2ipconfig /all→3ping gateway→4ping 8.8.8.8→5ping a name→6tracert
Everyday commands
| Task | Windows | Linux |
|---|
| IP settings | ipconfig /all | ip a, ip route |
| Reachability | ping | ping |
| Path | tracert | traceroute, mtr |
| DNS lookup | nslookup | dig, nslookup |
| Listening ports | netstat -ano | ss -tulpn |
| ARP table | arp -a | ip neigh |
| Port test | Test-NetConnection host -Port 443 | nc -zv host 443 |
| Services | Get-Service | systemctl status name |
| Logs | Event Viewer | journalctl -xe, /var/log |