Cheat Sheets

4 sheets, 87 rows, built to be printed and stuck next to a monitor. This is the reference the drills are testing you on, not practice itself.


Where the numbers come from

The subnet table is computed, not typed: every mask, wildcard and host count is derived from the prefix, so no row can be quietly wrong. The ports sheet is the same list the Ports & Protocols drill asks from, so the sheet and the drill cannot disagree with each other. A cheat sheet with one bad row is worse than no cheat sheet, because it is the thing people copy without checking.

Subnetting

Every prefix from /8 to /30, with the mask, the wildcard and how many hosts fit.

PrefixSubnet maskWildcardAddressesUsable hosts
/8255.0.0.00.255.255.25516,777,21616,777,214
/9255.128.0.00.127.255.2558,388,6088,388,606
/10255.192.0.00.63.255.2554,194,3044,194,302
/11255.224.0.00.31.255.2552,097,1522,097,150
/12255.240.0.00.15.255.2551,048,5761,048,574
/13255.248.0.00.7.255.255524,288524,286
/14255.252.0.00.3.255.255262,144262,142
/15255.254.0.00.1.255.255131,072131,070
/16255.255.0.00.0.255.25565,53665,534
/17255.255.128.00.0.127.25532,76832,766
/18255.255.192.00.0.63.25516,38416,382
/19255.255.224.00.0.31.2558,1928,190
/20255.255.240.00.0.15.2554,0964,094
/21255.255.248.00.0.7.2552,0482,046
/22255.255.252.00.0.3.2551,0241,022
/23255.255.254.00.0.1.255512510
/24255.255.255.00.0.0.255256254
/25255.255.255.1280.0.0.127128126
/26255.255.255.1920.0.0.636462
/27255.255.255.2240.0.0.313230
/28255.255.255.2400.0.0.151614
/29255.255.255.2480.0.0.786
/30255.255.255.2520.0.0.342
  • Usable = addresses − 2. The first address names the network and the last is its broadcast; neither can be assigned to a host.
  • /31 is the exception: RFC 3021 allows both addresses on a point-to-point link, so a /31 carries 2 usable, not 0.
  • /32 is a single host route: one address, no network or broadcast to lose.
  • The wildcard is the mask inverted. ACLs and OSPF network statements take the wildcard, not the mask.

Ports & protocols

The well-known ports, in number order. Same list the drill asks from.

PortServiceTransportWhat it is
20FTP dataTCPFile Transfer Protocol, data channel
21FTPTCPFile Transfer Protocol, control channel
22SSHTCPSecure Shell
23TelnetTCPTelnet: unencrypted remote login
25SMTPTCPSimple Mail Transfer Protocol
53DNSTCP + UDPDomain Name System
67DHCP serverUDPDHCP server
68DHCP clientUDPDHCP client
69TFTPUDPTrivial File Transfer Protocol
80HTTPTCPHypertext Transfer Protocol
110POP3TCPPost Office Protocol v3
123NTPUDPNetwork Time Protocol
137NetBIOS nameUDPNetBIOS name service
138NetBIOS datagramUDPNetBIOS datagram service
139NetBIOS sessionTCPNetBIOS session service
143IMAPTCPInternet Message Access Protocol
161SNMPUDPSimple Network Management Protocol
162SNMP trapUDPSNMP trap / notification
179BGPTCPBorder Gateway Protocol
389LDAPTCPLightweight Directory Access Protocol
443HTTPSTCPHTTP over TLS
445SMBTCPServer Message Block over TCP
500IKEUDPISAKMP / IKE, IPsec key exchange
514SyslogUDPSyslog
587SMTP submissionTCPMail submission
636LDAPSTCPLDAP over TLS
993IMAPSTCPIMAP over TLS
995POP3STCPPOP3 over TLS
1433MS SQLTCPMicrosoft SQL Server
1701L2TPUDPLayer 2 Tunneling Protocol
1723PPTPTCPPoint-to-Point Tunneling Protocol
3260iSCSITCPiSCSI target
3306MySQLTCPMySQL database
3389RDPTCPRemote Desktop Protocol
4500IPsec NAT-TUDPIPsec NAT traversal
5060SIPTCP + UDPSession Initiation Protocol
5061SIP-TLSTCPSIP over TLS
  • These are the IANA-registered assignments. Where real-world use differs (syslog over TCP, HTTPS over QUIC on UDP) the registered value is the one shown.
  • Ports below 1024 are the well-known range and normally need privilege to bind.

OSI & TCP/IP

Seven layers, what each one carries, and how they map onto the four-layer model.

LayerNameUnitLives hereTCP/IP model
7ApplicationDataHTTP, DNS, SMTP, SSHApplication
6PresentationDataTLS, character encoding, compressionApplication
5SessionDataSession setup and teardownApplication
4TransportSegment (TCP) / Datagram (UDP)Ports, reliability, flow controlTransport
3NetworkPacketIP addresses, routers, routingInternet
2Data linkFrameMAC addresses, switches, VLANs, ARPLink
1PhysicalBitsCable, optics, radio, connectorsLink
  • Encapsulation runs down the stack on the way out and back up on the way in: each layer wraps what the one above handed it.
  • A switch decides at layer 2 and a router at layer 3. That boundary is also where broadcast domains end.
  • ARP sits awkwardly between 2 and 3: it uses layer-2 broadcast to answer a layer-3 question. Interviewers ask about it for exactly that reason.

Cisco IOS commands

The commands you reach for first: look at things, change things, save things.

Look at things

show ip interface briefEvery interface, its address, and whether it is up
show ip routeThe routing table, with how each route was learned
show running-configThe configuration in memory, right now
show vlan briefVLANs and which access ports are in them
show interfaces trunkTrunk ports, their native VLAN and what they carry
show mac address-tableWhich MAC the switch has learned on which port
show cdp neighborsWhat is plugged into this device, and where
show versionModel, IOS version, uptime

Change things

configure terminalEnter configuration mode
interface gigabitethernet0/1Configure one interface
ip address 192.168.1.1 255.255.255.0Set an address and mask
no shutdownBring the interface up: routers boot theirs down
switchport mode accessOne VLAN, untagged, for an end device
switchport access vlan 10Which VLAN that port belongs to
switchport mode trunkCarry several VLANs, tagged with 802.1Q
ip route 0.0.0.0 0.0.0.0 203.0.113.1A default route to a next hop

Save and move around

copy running-config startup-configSave, or lose it at the next reload
endBack to privileged mode from anywhere
exitUp one level
do show ip routeRun a show command without leaving config mode
  • Nothing is saved until you copy running-config to startup-config. A reload undoes everything you did not save, which is occasionally the fastest way out of a mistake.
  • Most commands can be abbreviated as far as they stay unambiguous: sh ip int br is the same as show ip interface brief.
  • The address in the default route above is from 203.0.113.0/24, which RFC 5737 reserves for documentation.

A word on cheat sheets

Reference is not practice, and the two get confused. Reading the subnet table until it feels familiar is not the same as being able to produce a mask under time pressure: that is what the Subnet Trainer and the Speed Test are for. Print these, use them while you work, and let the drills tell you which rows you no longer need to look up.