Networking Cheatsheet

View saved

Use this sheet when you need a short definition and a command or example you can try right away.

Pair it with the Networking Tutorials for fuller explanations of each idea.

Examples work on Linux and Windows where both forms are shown; adapt for your OS.

Core ideas

Network

A group of devices that exchange data over shared links and agreed protocols.

# Home LAN: phones, PCs, printer, router
# Internet: many networks linked by ISPs and routers

Client and server

A client starts a request; a server provides the resource. Roles can flip by conversation.

# Browser (client) → web server (server)
# curl https://example.com

Protocol

Shared rules for formatting and exchanging messages so both ends understand the traffic.

# Common stacks
# IP + TCP + HTTPS
# IP + UDP + DNS

Packet / frame

A packet carries data across networks (IP). A frame carries it on the local link (Ethernet/Wi-Fi).

# Conceptual path
App data → TCP segment → IP packet → Ethernet/Wi-Fi frame

LAN vs internet

A LAN is a local network (home/office). The internet is networks of networks connected by routers.

# Same subnet → local switch/AP
# Different network → default gateway → ISP → internet

Addressing

IPv4 address

Four numbers 0–255 that identify a host or interface, often written with a prefix length.

192.168.1.24/24

Private IPv4 ranges

Addresses for LANs that are not routed on the public internet (RFC 1918).

10.0.0.0/8
172.16.0.0/12
192.168.0.0/16

Public vs private

Public addresses are unique on the internet. Private addresses stay inside a LAN and usually share one public IP via NAT.

# Typical home setup
PC: 192.168.1.50   (private)
Router WAN: 203.0.113.8  (public)

Subnet / prefix

A slice of address space that shares a network portion. /24 means the first 24 bits identify the network.

192.168.1.0/24
# Hosts often: 192.168.1.1 – 192.168.1.254

Default gateway

The local router address your device uses for traffic leaving the subnet.

# Common home gateway
192.168.1.1

# Linux: show default route
ip route | grep default

MAC address

A link-layer hardware address on a network interface, used for local delivery on Ethernet/Wi-Fi.

# Linux
ip link show

# Windows
ipconfig /all

Transport & ports

TCP

Connection-oriented transport with ordering and retransmission. Used for web, email, file transfers, and SSH.

# Reliable stream (conceptual)
CONNECT → send numbered data → ACK / retransmit if needed

UDP

Lightweight datagram transport without automatic recovery. Used for DNS, many games, and live media.

# Short query style
# DNS often uses UDP/53 for lookups

Port

A 16-bit number (0–65535) that identifies a service or conversation on a host, with TCP or UDP.

203.0.113.10:443
# IP + protocol + port = socket endpoint

Well-known ports

Familiar listening ports so clients know where common services wait.

22   SSH
53   DNS
80   HTTP
443  HTTPS
587  SMTP submission (often)

Ephemeral ports

Temporary high-numbered client ports chosen for outbound connections.

# Browser → server:443
# Local side might be 192.168.1.50:52144

Firewall (intro)

Rules that allow or block traffic by address, port, direction, or application. Host and network firewalls both exist.

# Typical home default
# Allow outbound you start
# Block unsolicited inbound

NAT

Network Address Translation lets many private hosts share one public address by rewriting and tracking conversations.

# Many LAN devices → one WAN IP
# Router tracks who started each flow

DNS & web

DNS

The Domain Name System maps human-readable names to IP addresses.

# Linux / macOS / Windows
nslookup example.com

# Linux / macOS also:
dig example.com

Resolver

The DNS server your device asks first—often the router, ISP, or a public resolver.

# Check configured DNS
# Linux: resolvectl status
# Windows: ipconfig /all

HTTP

Application protocol for the web: client request (method, path, headers) and server response (status + body).

GET /index.html HTTP/1.1
Host: example.com

HTTPS / TLS

HTTP over an encrypted TLS connection (usually port 443). Protects privacy and helps verify the server.

https://www.example.com/path
# Prefer the lock / HTTPS in the address bar

HTTP status codes

Short codes summarizing how the server handled the request.

200  OK
301/302  Redirect
404  Not found
500  Server error

URL pieces

Scheme, host, and path tell the client how to connect and what resource to ask for.

https://www.example.com/docs/intro
# scheme=https  host=www.example.com  path=/docs/intro

Tools

ping

Sends ICMP echo requests to test reachability and round-trip time. Not a full application test.

# Linux / macOS (Ctrl+C to stop)
ping 1.1.1.1
ping example.com

# Windows (4 probes by default)
ping 1.1.1.1

traceroute / tracert

Lists routers along the path to a destination to spot where delay or loss begins.

# Linux
traceroute example.com

# Windows
tracert example.com

ip / ipconfig

Show (and on some systems change) addresses, routes, and interface state.

# Linux
ip address
ip route

# Windows
ipconfig /all

nslookup / dig

Query DNS directly to see what a name resolves to and diagnose name problems.

nslookup example.com
dig example.com A

curl (quick check)

Fetch a URL from the command line to test HTTP/HTTPS without a browser.

curl -I https://example.com
# -I requests headers only

Troubleshooting

Start local

Confirm the link is up, you have an IP and gateway, then ping the gateway before blaming the internet.

# Checklist
# 1) Wi-Fi connected or Ethernet link up
# 2) IP + gateway present
# 3) ping <gateway>
# 4) try another device

IP works, name fails

If a public IP responds but a hostname does not, focus on DNS settings or cache.

ping 1.1.1.1
ping example.com
nslookup example.com

Renew DHCP

Refresh an automatic lease when the address is missing, stale, or wrong.

# Windows
ipconfig /release
ipconfig /renew

# Linux (NetworkManager example)
nmcli connection down "Wired connection 1"
nmcli connection up "Wired connection 1"

Wi-Fi vs Ethernet

Switch media to isolate radio problems. Stable Ethernet with bad Wi-Fi points at signal or interference.

# Compare
# Same site on cable vs wireless
# Move closer to AP / try 5 GHz when strong

Capture facts

Note IP, gateway, DNS, and whether ping/traceroute worked before changing settings or asking for help.

# Linux
ip address
ip route

# Windows
ipconfig /all

Comments

One comment per signed-in account. Comments are saved with this page’s URL.