Checking Reachability and Paths
Goal
You read interfaces and routing, interpret ping statistics, and run traceroute and mtr in the modes that work in this environment. At the end you prove for yourself that ICMP reachability and TCP reachability are different questions.
Why it matters
ping proves only up to the IP layer. It does not prove the port above it, the application, or even whether a large packet can pass. Conversely, a ping failure does not mean the server is down — many organizations block ICMP echo. In this lab environment, capabilities have been removed, so modes that need a raw socket, such as traceroute's TCP mode, do not work, and even the same tool works in some modes and not in others. This constraint itself is a good teaching aid: do not guess what a diagnostic tool requires; run it in that environment and decide.
Steps
- Create the
/root/reachdirectory and save a one-line-per-interface summary to/root/reach/iface.txt.lomust be included. - Save the routing table to
/root/reach/route.txt. There must be a line starting withdefault. - Save the full output of a 3-count ping to
127.0.0.1to/root/reach/ping-loop.txt. Packet loss must be 0%. - Save the output of a 3-count ping to your own default interface IP to
/root/reach/ping-self.txt. Loss must be 0%. - From the step 3 result, write only the three RTT values min / avg / max, separated by spaces, on one line in
/root/reach/rtt.txt. - Run traceroute to
127.0.0.1, save the output to/root/reach/trace.txt, and write the mode you used, in lowercase, on one line in/root/reach/trace-mode.txt(udp,icmp, ortcp). - Run an mtr report to
127.0.0.1for 3 cycles and save it to/root/reach/mtr.txt. TheLoss%header must be included. - Make
/root/reach/summary.txtwith the following 3 lines. Each value must be the result of actually trying it.icmp=<ok|fail>/tcp2222=<ok|fail>/tcp9999=<ok|fail>(You judge ICMP with127.0.0.1, and TCP with the corresponding port of127.0.0.1.)
Notes
- The combination
ip -br addr,ip route,ping -c 3,traceroute -n -m 3, andmtr --report -n -c 3solves most of it. - In this environment,
traceroute -Tfails for lack of permission, andmtr --udpprints only the header with empty hop lines (measured 2026-11-06). - You check a TCP port with
nc -zv -w 2 127.0.0.1 <port>. - Common mistake 1: writing four values including mdev in step 5. You need only three values.
- Common mistake 2: writing by guess without actually trying in step 8. Each line must be backed by command output.
Checking the interface list
Create the /root/reach directory and save a one-line-per-interface summary to /root/reach/iface.txt. lo must be included.
The ip command has a one-line summary format (-br). Both the loopback and the real interface must be visible.
Checking the routing table
Save the routing table to /root/reach/route.txt. There must be a line starting with default.
The default route is the line that starts with default. The gateway address comes after via.
Loopback ping
Save the full output of a 3-count ping to 127.0.0.1 to /root/reach/ping-loop.txt. Packet loss must be 0%.
If you set the count with -c, the statistics summary is printed at the end. The loss rate is on that summary line.
Ping to your own IP
Save the output of a 3-count ping to your own default interface IP to /root/reach/ping-self.txt. Loss must be 0%.
Use the interface address you confirmed in step 01. A packet going to yourself must have no loss either.
Reading the RTT statistics
From the step 3 result, write only the three RTT values min / avg / max, separated by spaces, on one line in /root/reach/rtt.txt.
On the last line of the statistics, min/avg/max/mdev come out separated by slashes. Pull out only the first three values.
traceroute in a mode that works
Run traceroute to 127.0.0.1, save the output to /root/reach/trace.txt, and write the mode you used, in lowercase, on one line in /root/reach/trace-mode.txt (udp, icmp, or tcp).
Each mode uses a different socket, so the permission requirements differ. Run the default, -I, and -T yourself, and write down one mode that produced hop lines.
mtr report
Run an mtr report to 127.0.0.1 for 3 cycles and save it to /root/reach/mtr.txt. The Loss% header must be included.
Whether mtr works also differs by mode — if the hop lines come out empty, run it in another mode. Use together the report mode that runs once and ends and the option that specifies the count.
Comparing ICMP and TCP
Make /root/reach/summary.txt with the following 3 lines. Each value must be the result of actually trying it.
icmp=<ok|fail> / tcp2222=<ok|fail> / tcp9999=<ok|fail>
(You judge ICMP with 127.0.0.1, and TCP with the corresponding port of 127.0.0.1.)
sshd is running on 2222 and nobody is listening on 9999. Think about what each of the three results proves.