Practice: Reaching Another Device
On this page
Laptop reaches phone, but later cannot reach web. You need to show where delivery stops, rather than report that “the network is broken.” First record the working local and routed cases. Then use the wrong-gateway fault to find a failed handoff and prove that repair restored it.
Before you start
Section titled “Before you start”Finish ICMP, ping, and traceroute. Keep modes off. Leave machine shells and run netlab reset from the VM prompt. Open two terminals on laptop using netlab shell laptop. Keep the VM prompt available for applying and repairing faults. All changes belong inside this closed lab.
Build an evidence record
Section titled “Build an evidence record”Meet these five goals. Choose commands from the preceding lessons. Write each prediction before sending, and keep the result next to it. Your report must distinguish an observed field from an explanation of what the device did with it.
- Capture one local exchange with phone and one routed exchange with web. Name the next-hop MAC address on laptop’s link for each, along with the packet destination.
- Read the neighbor table and explain why one remote destination needs a local neighbor entry. Include the ARP question and answer that supplied each link destination.
- Apply
wrong-gatewayfrom the VM. Find the route and neighbor evidence that explain the failed remote test. - Run a test that separates an unreachable next hop from a failed local link. Explain why that test supports your diagnosis.
- Repair from the VM, confirm the starting state, and record another successful routed exchange.
For each recording, keep its capture point, filter, traffic command and stopping method. Start terminal 1 before sending from terminal 2. Use sudo tcpdump -n -e -i eth0 -w delivery.pcap arp or icmp for the working pair, then read with tcpdump -n -e -r delivery.pcap. Choose a different filename for the fault and repaired runs. Stop each listener with Ctrl+C.
Clear laptop’s neighbors before the working pair so the questions appear. The option -w saves frames rather than printing them live; the read-back supplies the text evidence. Reading the saved file needs no sudo. Do not overwrite the first file when recording the failure. A successful final result does not replace evidence of the original problem.
Predict which address laptop will ask for under the fault. Then compare the failed attempt with your working remote exchange. Read the whole gateway address, including its last octet, before deciding the routes match.
Mistakes to recognize
Section titled “Mistakes to recognize”“Web is down because ping failed.” Check the next-hop question first. A frame that never reaches router says nothing about web’s service.
“The route names a gateway, so that gateway exists.” A table can contain an unusable instruction. Compare the instruction with actual ARP answers.
Good to know
Section titled “Good to know”Use netlab fix here rather than replacing a route by hand. It removes the named fault and restores the lab together. It also ends programs inside the lab machines. Stop listeners and leave machine shells first. Re-enter laptop and start another listener after repair.
Try it yourself
Section titled “Try it yourself”Run the experiments and compare your report with the required evidence before opening the solution. Use ping -c 1 -W 1 for the failed remote test, read ip neigh promptly, then test the real router’s local address. The short timeout keeps the unresolved entry visible; ARP retries can continue briefly after ping returns. Times, identifiers and round-trip times vary; your number will differ.
Hint
Use ip route to identify the selected gateway. Ask whether a neighbor answered for that exact address. Compare a test to router itself with the remote test.
Solution
learner@laptop:~$ sudo tcpdump -n -e -i eth0 -w delivery.pcap arp or icmp[sudo] password for learner: tcpdump: listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes^C8 packets captured
8 packets received by filter
0 packets dropped by kernellearner@laptop:~$ tcpdump -n -e -r delivery.pcapreading from file delivery.pcap, link-type EN10MB (Ethernet), snapshot length 262144
15:10:25.663603 02:77:10:00:00:10 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 10.77.10.11 tell 10.77.10.10, length 28
15:10:25.663647 02:77:10:00:00:11 > 02:77:10:00:00:10, ethertype ARP (0x0806), length 42: Reply 10.77.10.11 is-at 02:77:10:00:00:11, length 28
15:10:25.663649 02:77:10:00:00:10 > 02:77:10:00:00:11, ethertype IPv4 (0x0800), length 98: 10.77.10.10 > 10.77.10.11: ICMP echo request, id 170, seq 1, length 64
15:10:25.663675 02:77:10:00:00:11 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 98: 10.77.10.11 > 10.77.10.10: ICMP echo reply, id 170, seq 1, length 64
15:10:26.166966 02:77:10:00:00:10 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 10.77.10.1 tell 10.77.10.10, length 28
15:10:26.167010 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype ARP (0x0806), length 42: Reply 10.77.10.1 is-at 02:77:10:00:00:01, length 28
15:10:26.167012 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 98: 10.77.10.10 > 10.77.20.80: ICMP echo request, id 171, seq 1, length 64
15:10:26.167078 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 98: 10.77.20.80 > 10.77.10.10: ICMP echo reply, id 171, seq 1, length 64learner@laptop:~$ Steps (12)
- Type
sudo tcpdump -n -e -i eth0 -w delivery.pcap arp or icmp - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Output:
tcpdump: listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes - Terminal 2 finished its tests. Return here and stop the listener with Ctrl+C.
- Press Ctrl + C
- Output:
8 packets captured 8 packets received by filter 0 packets dropped by kernel - Type
tcpdump -n -e -r delivery.pcap - Press Enter
- Output:
reading from file delivery.pcap, link-type EN10MB (Ethernet), snapshot length 262144 15:10:25.663603 02:77:10:00:00:10 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 10.77.10.11 tell 10.77.10.10, length 28 15:10:25.663647 02:77:10:00:00:11 > 02:77:10:00:00:10, ethertype ARP (0x0806), length 42: Reply 10.77.10.11 is-at 02:77:10:00:00:11, length 28 15:10:25.663649 02:77:10:00:00:10 > 02:77:10:00:00:11, ethertype IPv4 (0x0800), length 98: 10.77.10.10 > 10.77.10.11: ICMP echo request, id 170, seq 1, length 64 15:10:25.663675 02:77:10:00:00:11 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 98: 10.77.10.11 > 10.77.10.10: ICMP echo reply, id 170, seq 1, length 64 15:10:26.166966 02:77:10:00:00:10 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 10.77.10.1 tell 10.77.10.10, length 28 15:10:26.167010 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype ARP (0x0806), length 42: Reply 10.77.10.1 is-at 02:77:10:00:00:01, length 28 15:10:26.167012 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 98: 10.77.10.10 > 10.77.20.80: ICMP echo request, id 171, seq 1, length 64 15:10:26.167078 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 98: 10.77.20.80 > 10.77.10.10: ICMP echo reply, id 171, seq 1, length 64
learner@laptop:~$ sudo ip neigh flush dev eth0[sudo] password for learner: learner@laptop:~$ ping -c 1 10.77.10.11PING 10.77.10.11 (10.77.10.11) 56(84) bytes of data.
64 bytes from 10.77.10.11: icmp_seq=1 ttl=64 time=0.131 ms
--- 10.77.10.11 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.131/0.131/0.131/0.000 mslearner@laptop:~$ ping -c 1 10.77.20.80PING 10.77.20.80 (10.77.20.80) 56(84) bytes of data.
64 bytes from 10.77.20.80: icmp_seq=1 ttl=63 time=0.146 ms
--- 10.77.20.80 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.146/0.146/0.146/0.000 mslearner@laptop:~$ ip neigh10.77.10.1 dev eth0 lladdr 02:77:10:00:00:01 REACHABLE
10.77.10.11 dev eth0 lladdr 02:77:10:00:00:11 REACHABLE learner@laptop:~$ Steps (14)
- Type
sudo ip neigh flush dev eth0 - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Type
ping -c 1 10.77.10.11 - Press Enter
- Output:
PING 10.77.10.11 (10.77.10.11) 56(84) bytes of data. 64 bytes from 10.77.10.11: icmp_seq=1 ttl=64 time=0.131 ms --- 10.77.10.11 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.131/0.131/0.131/0.000 ms - Type
ping -c 1 10.77.20.80 - Press Enter
- Output:
PING 10.77.20.80 (10.77.20.80) 56(84) bytes of data. 64 bytes from 10.77.20.80: icmp_seq=1 ttl=63 time=0.146 ms --- 10.77.20.80 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.146/0.146/0.146/0.000 ms - Type
ip neigh - Press Enter
- Output:
10.77.10.1 dev eth0 lladdr 02:77:10:00:00:01 REACHABLE 10.77.10.11 dev eth0 lladdr 02:77:10:00:00:11 REACHABLE
The saved-file read shows phone’s next-hop 02:77:10:00:00:11; its packet names 10.77.10.11. Web uses next-hop 02:77:10:00:00:01; its packet names 10.77.20.80. Read the outer frame address separately from the carried packet address.
learner@rootvolt:~$ netlab break wrong-gateway[sudo] password for learner: Fault wrong-gateway applied.learner@rootvolt:~$ netlab statusLab is up. Modes on: none. Fault: wrong-gateway.
MACHINE NETWORK ADDRESS DEFAULT ROUTE COMPARED WITH THE START
laptop home 10.77.10.10/24 10.77.10.254 changed
phone home 10.77.10.11/24 10.77.10.1 same
router home, site 10.77.10.1/24 10.77.20.1/24 - same
web site 10.77.20.80/24 10.77.20.1 same
Changed since the start:
laptop: default route 10.77.10.254 (start: 10.77.10.1)
Switch sw-home (home): laptop, phone, router
Switch sw-site (site): router, web
Services: web http 80, web https 443, web http 8080, web ssh 22learner@rootvolt:~$ Steps (9)
- Type
netlab break wrong-gateway - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Output:
Fault wrong-gateway applied. - Type
netlab status - Press Enter
- Output:
Lab is up. Modes on: none. Fault: wrong-gateway. MACHINE NETWORK ADDRESS DEFAULT ROUTE COMPARED WITH THE START laptop home 10.77.10.10/24 10.77.10.254 changed phone home 10.77.10.11/24 10.77.10.1 same router home, site 10.77.10.1/24 10.77.20.1/24 - same web site 10.77.20.80/24 10.77.20.1 same Changed since the start: laptop: default route 10.77.10.254 (start: 10.77.10.1) Switch sw-home (home): laptop, phone, router Switch sw-site (site): router, web Services: web http 80, web https 443, web http 8080, web ssh 22
learner@laptop:~$ sudo tcpdump -n -e -i eth0 -w fault.pcap arp or icmp[sudo] password for learner: tcpdump: listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes^C7 packets captured
7 packets received by filter
0 packets dropped by kernellearner@laptop:~$ tcpdump -n -e -r fault.pcapreading from file fault.pcap, link-type EN10MB (Ethernet), snapshot length 262144
15:10:52.881570 02:77:10:00:00:10 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 10.77.10.254 tell 10.77.10.10, length 28
15:10:53.905626 02:77:10:00:00:10 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 10.77.10.254 tell 10.77.10.10, length 28
15:10:54.891769 02:77:10:00:00:10 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 10.77.10.1 tell 10.77.10.10, length 28
15:10:54.891814 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype ARP (0x0806), length 42: Reply 10.77.10.1 is-at 02:77:10:00:00:01, length 28
15:10:54.891816 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 98: 10.77.10.10 > 10.77.10.1: ICMP echo request, id 172, seq 1, length 64
15:10:54.891879 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 98: 10.77.10.1 > 10.77.10.10: ICMP echo reply, id 172, seq 1, length 64
15:10:54.929682 02:77:10:00:00:10 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 10.77.10.254 tell 10.77.10.10, length 28learner@laptop:~$ Steps (12)
- Type
sudo tcpdump -n -e -i eth0 -w fault.pcap arp or icmp - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Output:
tcpdump: listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes - Terminal 2 finished its tests. Return here and stop the listener with Ctrl+C.
- Press Ctrl + C
- Output:
7 packets captured 7 packets received by filter 0 packets dropped by kernel - Type
tcpdump -n -e -r fault.pcap - Press Enter
- Output:
reading from file fault.pcap, link-type EN10MB (Ethernet), snapshot length 262144 15:10:52.881570 02:77:10:00:00:10 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 10.77.10.254 tell 10.77.10.10, length 28 15:10:53.905626 02:77:10:00:00:10 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 10.77.10.254 tell 10.77.10.10, length 28 15:10:54.891769 02:77:10:00:00:10 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 10.77.10.1 tell 10.77.10.10, length 28 15:10:54.891814 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype ARP (0x0806), length 42: Reply 10.77.10.1 is-at 02:77:10:00:00:01, length 28 15:10:54.891816 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 98: 10.77.10.10 > 10.77.10.1: ICMP echo request, id 172, seq 1, length 64 15:10:54.891879 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 98: 10.77.10.1 > 10.77.10.10: ICMP echo reply, id 172, seq 1, length 64 15:10:54.929682 02:77:10:00:00:10 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 10.77.10.254 tell 10.77.10.10, length 28
learner@laptop:~$ ip routedefault via 10.77.10.254 dev eth0
10.77.10.0/24 dev eth0 proto kernel scope link src 10.77.10.10 learner@laptop:~$ ping -c 1 -W 1 10.77.20.80PING 10.77.20.80 (10.77.20.80) 56(84) bytes of data.
--- 10.77.20.80 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0mslearner@laptop:~$ ip neigh10.77.10.254 dev eth0 INCOMPLETE learner@laptop:~$ ping -c 1 10.77.10.1PING 10.77.10.1 (10.77.10.1) 56(84) bytes of data.
64 bytes from 10.77.10.1: icmp_seq=1 ttl=64 time=0.122 ms
--- 10.77.10.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.122/0.122/0.122/0.000 mslearner@laptop:~$ Steps (12)
- Type
ip route - Press Enter
- Output:
default via 10.77.10.254 dev eth0 10.77.10.0/24 dev eth0 proto kernel scope link src 10.77.10.10 - Type
ping -c 1 -W 1 10.77.20.80 - Press Enter
- Output:
PING 10.77.20.80 (10.77.20.80) 56(84) bytes of data. --- 10.77.20.80 ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms - Type
ip neigh - Press Enter
- Output:
10.77.10.254 dev eth0 INCOMPLETE - Type
ping -c 1 10.77.10.1 - Press Enter
- Output:
PING 10.77.10.1 (10.77.10.1) 56(84) bytes of data. 64 bytes from 10.77.10.1: icmp_seq=1 ttl=64 time=0.122 ms --- 10.77.10.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.122/0.122/0.122/0.000 ms
The default says default via 10.77.10.254 dev eth0. The neighbor read shows 10.77.10.254 dev eth0 INCOMPLETE: laptop is still trying to resolve it. The saved-file replay shows three ARP requests for that address with no answer. Ping to 10.77.10.1 still succeeds. That local test proves laptop can exchange frames with the real gateway, while the configured remote handoff points elsewhere.
learner@rootvolt:~$ netlab fix[sudo] password for learner: Fault wrong-gateway removed.learner@rootvolt:~$ netlab statusLab is up. Modes on: none. Fault: none.
MACHINE NETWORK ADDRESS DEFAULT ROUTE COMPARED WITH THE START
laptop home 10.77.10.10/24 10.77.10.1 same
phone home 10.77.10.11/24 10.77.10.1 same
router home, site 10.77.10.1/24 10.77.20.1/24 - same
web site 10.77.20.80/24 10.77.20.1 same
Switch sw-home (home): laptop, phone, router
Switch sw-site (site): router, web
Services: web http 80, web https 443, web http 8080, web ssh 22learner@rootvolt:~$ Steps (9)
- Type
netlab fix - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Output:
Fault wrong-gateway removed. - Type
netlab status - Press Enter
- Output:
Lab is up. Modes on: none. Fault: none. MACHINE NETWORK ADDRESS DEFAULT ROUTE COMPARED WITH THE START laptop home 10.77.10.10/24 10.77.10.1 same phone home 10.77.10.11/24 10.77.10.1 same router home, site 10.77.10.1/24 10.77.20.1/24 - same web site 10.77.20.80/24 10.77.20.1 same Switch sw-home (home): laptop, phone, router Switch sw-site (site): router, web Services: web http 80, web https 443, web http 8080, web ssh 22
learner@laptop:~$ sudo tcpdump -n -e -i eth0 -w repaired.pcap arp or icmp[sudo] password for learner: tcpdump: listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes^C4 packets captured
4 packets received by filter
0 packets dropped by kernellearner@laptop:~$ tcpdump -n -e -r repaired.pcapreading from file repaired.pcap, link-type EN10MB (Ethernet), snapshot length 262144
15:11:21.085895 02:77:10:00:00:10 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 10.77.10.1 tell 10.77.10.10, length 28
15:11:21.085952 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype ARP (0x0806), length 42: Reply 10.77.10.1 is-at 02:77:10:00:00:01, length 28
15:11:21.085953 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 98: 10.77.10.10 > 10.77.20.80: ICMP echo request, id 168, seq 1, length 64
15:11:21.085995 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 98: 10.77.20.80 > 10.77.10.10: ICMP echo reply, id 168, seq 1, length 64learner@laptop:~$ Steps (12)
- Type
sudo tcpdump -n -e -i eth0 -w repaired.pcap arp or icmp - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Output:
tcpdump: listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes - Terminal 2 finished its tests. Return here and stop the listener with Ctrl+C.
- Press Ctrl + C
- Output:
4 packets captured 4 packets received by filter 0 packets dropped by kernel - Type
tcpdump -n -e -r repaired.pcap - Press Enter
- Output:
reading from file repaired.pcap, link-type EN10MB (Ethernet), snapshot length 262144 15:11:21.085895 02:77:10:00:00:10 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 10.77.10.1 tell 10.77.10.10, length 28 15:11:21.085952 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype ARP (0x0806), length 42: Reply 10.77.10.1 is-at 02:77:10:00:00:01, length 28 15:11:21.085953 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 98: 10.77.10.10 > 10.77.20.80: ICMP echo request, id 168, seq 1, length 64 15:11:21.085995 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 98: 10.77.20.80 > 10.77.10.10: ICMP echo reply, id 168, seq 1, length 64
learner@laptop:~$ ip routedefault via 10.77.10.1 dev eth0
10.77.10.0/24 dev eth0 proto kernel scope link src 10.77.10.10 learner@laptop:~$ ping -c 1 10.77.20.80PING 10.77.20.80 (10.77.20.80) 56(84) bytes of data.
64 bytes from 10.77.20.80: icmp_seq=1 ttl=63 time=0.234 ms
--- 10.77.20.80 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.234/0.234/0.234/0.000 mslearner@laptop:~$ ip neigh10.77.10.1 dev eth0 lladdr 02:77:10:00:00:01 REACHABLE learner@laptop:~$ Steps (9)
- Type
ip route - Press Enter
- Output:
default via 10.77.10.1 dev eth0 10.77.10.0/24 dev eth0 proto kernel scope link src 10.77.10.10 - Type
ping -c 1 10.77.20.80 - Press Enter
- Output:
PING 10.77.20.80 (10.77.20.80) 56(84) bytes of data. 64 bytes from 10.77.20.80: icmp_seq=1 ttl=63 time=0.234 ms --- 10.77.20.80 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.234/0.234/0.234/0.000 ms - Type
ip neigh - Press Enter
- Output:
10.77.10.1 dev eth0 lladdr 02:77:10:00:00:01 REACHABLE
The restored default uses 10.77.10.1, and web answers. This supports the gateway diagnosis. Keep the before-and-after route reads with the failed and working captures.
Recall check
Section titled “Recall check”Does a packet to a remote server carry that server’s MAC address on the client’s own link?
Answer
No. Its surrounding frame names the local next hop. The packet names the remote IP destination. A router builds another frame for the next link.
- Name the next hop separately from the packet destination.
- Use route, neighbor and capture evidence together.
- Confirm a repaired state with a repeated exchange.
Next, TCP, UDP, and Ports follows messages to the programs that use them.