A fresh start.
Not from scratch.
You’ve done this before. Give yourself room to remember.
fast-track items done · 72 days
This week, focus timer and pacing
Reconnect the network basics
Explain a packet journey and diagnose simple addressing, switching and DNS faults with notes available first.
Write version 0 of four work stories: a troubleshooting case, an incident you handled, a difficult change and a mistake you corrected. Use the format from Interview stories, polish pass: situation, your responsibility, your action, the evidence and the result, in five lines each. Rough is fine. Week 17 polishes them.
Remember, then stretch.
Standard day: six hours of study. 90 minutes refresh, 120 practical, 45 recall, 45 notes and evidence, 60 spaced review. Applications on top: 30 minutes.
Busy day: 20 minutes refresh, 60 practice, 20 recall, 10 notes, plus 10 minutes of applications. Keep the same session open if unfinished.
Follow a packet core
Almost every network ticket and most network interview questions start with "what happens when a host talks to a server?" If you know which address changes at each hop and which stays fixed, you can read captures, firewall logs and NAT tables correctly instead of guessing.
Prerequisites: none. This is the first session.
Lab: one Linux Mint 22.3 or Ubuntu 24.04 machine on a home or lab network with internet access. Only capture on networks you own or are allowed to monitor. Install the tools and allow your user to capture without root:
Answer Yes when dpkg-reconfigure asks whether non-superusers should be able to capture packets. Log out and back in, then check that id -nG | grep -w wireshark prints wireshark and that tshark -D lists your interfaces.
sudo apt update
sudo apt install wireshark tshark bind9-dnsutils curl iproute2 iputils-ping
sudo dpkg-reconfigure wireshark-common
sudo usermod -a -G wireshark "$USER"Tested with: Linux Mint 22.3 (Ubuntu 24.04 base), kernel 7.0, iproute2 6.1.0, TShark 4.2.2, BIND dig 9.18.39, curl 8.5.0.
- IP address: identifies the endpoint; stays the same unless NAT changes it.
- MAC address: means something on one link only; replaced on every link.
- Local or remote: the prefix says which addresses share your link.
- Local: send to the destination's MAC. Remote: send to the gateway's MAC.
- ARP finds a MAC on the link. Each router lowers the TTL by one.
laptop ---link 1--- home router (NAT) ---link 2--- ISP router ---link 3--- server
192.168.1.20 192.168.1.1 | 198.51.100.7 203.0.113.10
frame on link 1 frame on link 2 frame on link 3
destination MAC home router (LAN) ISP router server
source IP 192.168.1.20 198.51.100.7 (after NAT) 198.51.100.7
destination IP 203.0.113.10 203.0.113.10 203.0.113.10
TTL 64 63 62Part 1: two addresses, two jobs
When your laptop talks to a web server, the data travels wrapped in layers. The application data sits inside a TCP segment, which carries port numbers. The segment sits inside an IP packet, which carries the source and destination IP addresses. The packet sits inside an Ethernet frame, which carries source and destination MAC addresses. Wi-Fi frames carry MAC addresses the same way.
An IP address identifies an endpoint across networks. It stays the same from your laptop to the server, unless NAT changes it (Part 2). A MAC address is the 48-bit hardware address of one network interface. It only means something on one link: a stretch of network with no router in between.
Your laptop knows its own address and prefix, for example 192.168.1.20/24. The prefix says which addresses share its link: here, 192.168.1.0 to 192.168.1.255. For anything else the laptop uses its route table, a list of destination ranges and where to send each one. The default route (shown as default) matches everything no other route matches. It points to the default gateway: the router on your link that forwards traffic onward. Before any of this, DNS (the system that turns names into IP addresses, session 5) has already given the browser the server's IP.
So the laptop's first decision is local or remote. Local: send the frame straight to the destination's MAC. Remote: send the frame to the gateway's MAC, with the server's IP still inside the packet.
Quick check: your laptop is 192.168.1.20/24 and sends to 192.168.1.77. Does it use the gateway?
No. 192.168.1.77 is inside the /24, so the frame goes straight to that host's MAC.
Part 2: finding the MAC, and what changes at each hop
The laptop knows the gateway's IP from the route table, but a frame needs a MAC. ARP (Address Resolution Protocol, used by IPv4) finds it. The laptop broadcasts "Who has 192.168.1.1? Tell 192.168.1.20" to every device on the link, using destination MAC ff:ff:ff:ff:ff:ff. The gateway replies with its MAC. The laptop stores the answer in its neighbour cache, so it does not ask again for every packet. IPv6 does the same job with Neighbor Discovery instead of ARP.
Each router that receives the frame removes the Ethernet header, reads the destination IP, looks up its own route table, lowers the TTL (time to live, a hop counter that stops packets looping forever) by one, and builds a new frame for the next link. IP addresses stay; MAC addresses are replaced on every link.
A home router usually also does NAT (network address translation). It rewrites your private source address to its own public address and may change the source port. The server sees the router's address, not yours.
laptop ---link 1--- home router (NAT) ---link 2--- ISP router ---link 3--- server
192.168.1.20 192.168.1.1 | 198.51.100.7 203.0.113.10
frame on link 1 frame on link 2 frame on link 3
destination MAC home router (LAN) ISP router server
source IP 192.168.1.20 198.51.100.7 (after NAT) 198.51.100.7
destination IP 203.0.113.10 203.0.113.10 203.0.113.10
TTL 64 63 62Common misconception: "The frame leaving my laptop carries the server's MAC address." It cannot. ARP broadcasts never cross a router, so the laptop has no way to learn a MAC address on another link. The destination MAC on the first link is always the next hop, which for remote traffic is the gateway.
Quick check: between link 1 and link 2 above, which change: destination MAC, destination IP, TTL?
Destination MAC and TTL. The destination IP stays the same.
The question: your laptop (192.168.1.20/24, gateway 192.168.1.1) opens https://example.com, which resolved to 203.0.113.10. Prove where the first frame goes, using evidence instead of memory.
Step 1. Ask the kernel which route it would use.
Sample output, illustrative: your addresses and interface name will differ. via 192.168.1.1 means the destination is remote and the next hop is the gateway. dev wlan0 is the interface the frame will leave on. src is the address the laptop will put in the packet.
$ ip route get 203.0.113.10
203.0.113.10 via 192.168.1.1 dev wlan0 src 192.168.1.20 uid 1000
cacheStep 2. Find the next hop's MAC.
Illustrative. lladdr is the link-layer (MAC) address that ARP learned. REACHABLE means it was confirmed recently. STALE would mean it is cached but not recently confirmed; the kernel still uses it and re-checks it.
$ ip neigh show 192.168.1.1
192.168.1.1 dev wlan0 lladdr 02:00:00:00:00:fe REACHABLEStep 3. Capture the first packets and compare.
Illustrative, but the format matches a real TShark 4.2.2 capture taken for this session. Reasoning, one line at a time:
- Observation: the SYN's destination MAC (
02:00:00:00:00:fe) equals the gateway's MAC from step 2, while its destination IP is the server. That is the remote case from Part 1. - Observation: the reply's source MAC is also the gateway. Replies from the internet always arrive from your gateway, never from the server's own interface.
- Observation: the reply arrives with TTL 55.
- Inference, not observation: if the server sent it with TTL 64 (a common starting value), about nine routers sit on the return path. The capture cannot show the starting value, so keep this as a hypothesis.
$ tshark -i wlan0 -f "host 203.0.113.10 and tcp port 443" -c 3 \
-T fields -e eth.src -e eth.dst -e ip.src -e ip.dst -e ip.ttl -e tcp.flags.str
02:00:00:00:00:14 02:00:00:00:00:fe 192.168.1.20 203.0.113.10 64 ··········S·
02:00:00:00:00:fe 02:00:00:00:00:14 203.0.113.10 192.168.1.20 55 ·······A··S·
02:00:00:00:00:14 02:00:00:00:00:fe 192.168.1.20 203.0.113.10 64 ·······A····RFC 1122, section 3.3.1 "Routing Outbound Datagrams" (page 47): the host requirements for the local-or-remote decision and gateway selection.
Platform: Linux Mint 22.3 or Ubuntu 24.04, in one terminal.
- List your interfaces and addresses.
- What this does: prints one line per interface with its state and addresses.
- What to look for: the interface that is
UPwith an IPv4 address and prefix, such as192.168.0.131/24.
Explained in Part 1: two addresses, two jobs
ip -br addr show- Find the default gateway and save it and the interface in variables.
- What this does: reads the line
default via <gateway> dev <interface> ...and keeps the third and fifth words. - What to look for: a gateway inside your own prefix, and the same interface as step 1.
Explained in Part 1: two addresses, two jobs
ip route show default
GW=$(ip route show default | awk '{print $3; exit}')
IFACE=$(ip route show default | awk '{print $5; exit}')
echo "gateway=$GW interface=$IFACE"- Resolve
example.comand keep the first IPv4 address.
- What this does: asks DNS for the A (IPv4) records and keeps the first one.
- What to look for: one IPv4 address. You may see two different addresses if you run
digagain; both are valid.
Explained in Part 1: two addresses, two jobs
IP=$(dig +short example.com A | head -n1)
echo "$IP"- Ask the kernel how it would reach that address.
- What this does: runs the route lookup without sending anything.
- What to look for:
viafollowed by your gateway. That word is the local-or-remote decision.
Explained in Part 1: two addresses, two jobs
ip route get "$IP"- Show the gateway's MAC address.
- What this does: prints the neighbour-cache entry ARP created for the gateway.
- What to look for:
lladdrand a MAC address. Write it down.
Explained in Part 2: finding the MAC, and what changes at each hop
ip neigh show "$GW"- Capture the start of one HTTPS connection to that exact address.
- What this does: starts TShark in the background with a capture filter for that server, then makes one request.
--resolvepinsexample.comto the address you saved, so the request goes where the filter is looking. - What to look for: three lines, then TShark exits. The first line has
Sin the flags (a SYN).
Explained in Part 2: finding the MAC, and what changes at each hop and the worked example
tshark -i "$IFACE" -f "host $IP and tcp port 443" -c 3 -a duration:15 \
-T fields -e eth.src -e eth.dst -e ip.src -e ip.dst -e ip.ttl -e tcp.flags.str &
sleep 2
curl -sI --resolve "example.com:443:$IP" https://example.com/ >/dev/null- Compare the SYN line with steps 3 and 5.
- What this does: checks your model against the evidence.
- What to look for: destination MAC equals the gateway's MAC; destination IP equals
$IP; source IP is your own private address.
Explained in Part 2: finding the MAC, and what changes at each hop
- Watch ARP for an address nobody uses. Pick one inside your prefix that is not in
ip neigh show dev "$IFACE"(for example.250of your network).
- What this does: pings a local address, so the laptop must ARP for it first.
- What to look for: requests to
ff:ff:ff:ff:ff:ffwith opcode1(request) and no reply. The neighbour entry ends asFAILED, andpingreports 100% loss. No IP packet left your laptop, because it never learned a MAC to send it to.
Explained in Part 2: finding the MAC, and what changes at each hop
tshark -i "$IFACE" -f "arp" -c 3 -a duration:10 \
-T fields -e eth.dst -e arp.opcode -e arp.src.proto_ipv4 -e arp.dst.proto_ipv4 &
sleep 2
ping -c 3 192.168.0.250
ip neigh show 192.168.0.250You should find a default route via your gateway and a REACHABLE or STALE neighbour entry for it. The DNS answer contains at least one IPv4 address. The captured SYN carries your gateway's MAC as destination and the server's IP as destination. A normal TCP connection begins SYN, SYN-ACK, ACK; HTTPS follows. For the unused local address you see unanswered ARP requests and a FAILED entry.
Stuck or seeing something else?
tsharksays permission denied: you have not logged in again since joining thewiresharkgroup. Check withid -nG.- No packets captured: check
$IPand$IFACEare not empty (echo "$IP $IFACE"). The variables only exist in the terminal where you set them. - No SYN: the request may have gone over IPv6 or reused a connection.
--resolvewith an IPv4 address forces a new IPv4 connection. Do not guess from a blank capture; widen the filter totcp port 443and retry. - On Wi-Fi: Linux shows normal captures with Ethernet headers, so
eth.srcandeth.dststill work. The MAC logic is the same. ip neighshows nothing for the gateway: send any traffic first (ping -c 1 "$GW"), then look again.
Repeat the investigation for a device on your own subnet, such as your phone or a TV, and prove from evidence that no gateway is involved. Find the device's IP in its Wi-Fi settings or in ip neigh show dev "$IFACE".
Asked in 16 separate sources, 8 first-hand · network, network security, SOC interviews
Asked in 4 separate sources · network, network security, SOC interviews
Asked in 3 separate sources, 2 first-hand · network interviews
Asked in 3 separate sources, 1 first-hand · network, SOC interviews
Check all four steps when you have actually done them.