Bird
Raised Fist0
Linux CLIscripting~20 mins

traceroute for path tracing in Linux CLI - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Traceroute Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
1:30remaining
What is the output of this traceroute command?
You run the command traceroute -m 3 example.com. What does the -m 3 option do?
Linux CLI
traceroute -m 3 example.com
ASends 3 probes per hop instead of the default 1.
BSpecifies the port number 3 for traceroute packets.
CSets the timeout for each probe to 3 seconds.
DLimits the maximum number of hops to 3, so traceroute stops after 3 hops.
Attempts:
2 left
💡 Hint
Think about what 'max hops' means in network path tracing.
💻 Command Output
intermediate
1:30remaining
What does this traceroute output indicate?
You run traceroute example.com and see this output for the first hop:
 1  192.168.1.1  1.123 ms  1.045 ms  1.012 ms

What does this line mean?
Linux CLI
traceroute example.com
AThe first hop is the router at IP 192.168.1.1, and it responded in about 1 ms each time.
BThe traceroute failed to reach the first hop.
CThe IP 192.168.1.1 is unreachable.
DThe traceroute is showing the destination server's IP.
Attempts:
2 left
💡 Hint
The first hop is usually your local router or gateway.
🔧 Debug
advanced
1:30remaining
Why does this traceroute command fail with 'command not found'?
You type traceoute example.com but get bash: traceoute: command not found. What is the problem?
Linux CLI
traceoute example.com
AThe domain 'example.com' does not exist.
BYou need to run the command as root.
CThe command is misspelled; it should be 'traceroute'.
DTraceroute is not installed by default on Linux.
Attempts:
2 left
💡 Hint
Check the spelling carefully.
🚀 Application
advanced
2:00remaining
How to save traceroute output to a file for later analysis?
You want to run traceroute example.com and save the output to a file named trace.txt. Which command does this correctly?
AAll of the above
Btraceroute example.com >> trace.txt
Ctraceroute example.com > trace.txt
Dtraceroute example.com | tee trace.txt
Attempts:
2 left
💡 Hint
Think about how output redirection and tee work.
🧠 Conceptual
expert
2:00remaining
What does an asterisk (*) mean in traceroute output?
In traceroute output, sometimes you see lines like:
 4  * * *

What does this mean?
AThe network is blocking traceroute packets permanently.
BThe probe timed out; no response was received from that hop.
CTraceroute completed successfully at this hop.
DThe hop is the destination server.
Attempts:
2 left
💡 Hint
Think about what no response means in network tracing.

Practice

(1/5)
1. What is the main purpose of the traceroute command in Linux?
easy
A. To display current network connections
B. To list all files in a directory
C. To change the IP address of the system
D. To show the path data takes to reach a destination

Solution

  1. Step 1: Understand traceroute function

    The traceroute command traces the route packets take to reach a network host.
  2. Step 2: Compare options

    Options A, B, and D describe unrelated commands or functions.
  3. Final Answer:

    To show the path data takes to reach a destination -> Option D
  4. Quick Check:

    Traceroute purpose = show path [OK]
Hint: Traceroute maps network path hops quickly [OK]
Common Mistakes:
  • Confusing traceroute with ping
  • Thinking traceroute changes network settings
  • Mixing traceroute with file commands
2. Which of the following is the correct syntax to run traceroute to example.com with a maximum of 5 hops?
easy
A. traceroute -m 5 example.com
B. traceroute -max 5 example.com
C. traceroute --maxhops=5 example.com
D. traceroute -h 5 example.com

Solution

  1. Step 1: Recall traceroute max hops option

    The option -m sets the max number of hops in traceroute.
  2. Step 2: Check syntax correctness

    Only traceroute -m 5 example.com uses the correct option and format.
  3. Final Answer:

    traceroute -m 5 example.com -> Option A
  4. Quick Check:

    Max hops option = -m [OK]
Hint: Use -m to limit hops in traceroute [OK]
Common Mistakes:
  • Using -max or --maxhops which are invalid
  • Confusing -h (help) with hop limit
  • Placing options after the hostname
3. What will be the output of the command traceroute -n 8.8.8.8?
medium
A. It shows an error because -n is invalid
B. It shows the route to 8.8.8.8 with hostnames only, no IP addresses
C. It shows the route to 8.8.8.8 with IP addresses only, no hostnames
D. It shows the route with both hostnames and IP addresses

Solution

  1. Step 1: Understand the -n option in traceroute

    The -n option disables hostname resolution and shows IP addresses only.
  2. Step 2: Analyze output format

    Therefore, the output will list IP addresses without hostnames.
  3. Final Answer:

    It shows the route to 8.8.8.8 with IP addresses only, no hostnames -> Option C
  4. Quick Check:

    -n means no hostname lookup [OK]
Hint: -n shows IPs only, no names [OK]
Common Mistakes:
  • Thinking -n shows hostnames
  • Assuming -n causes error
  • Expecting both IP and hostname with -n
4. You run traceroute -m 3 example.com but it shows more than 3 hops. What is the likely cause?
medium
A. The -m option was ignored because of a syntax error
B. Traceroute always shows all hops regardless of -m
C. The command is correct; traceroute shows up to 3 hops only
D. The hostname resolves to multiple IPs causing extra hops

Solution

  1. Step 1: Check syntax of the command

    The correct syntax requires a space between -m and the number, so -m 3 is correct.
  2. Step 2: Consider possible syntax errors

    If the option was typed incorrectly (like -m3 without space), traceroute may ignore it and show default hops.
  3. Step 3: Evaluate other options

    Traceroute does not always ignore -m; it respects it if syntax is correct. Multiple IPs do not increase hops count.
  4. Final Answer:

    The -m option was ignored because of a syntax error -> Option A
  5. Quick Check:

    Syntax error causes option ignore [OK]
Hint: Check option syntax carefully for -m [OK]
Common Mistakes:
  • Using -m3 without space causing ignore
  • Assuming traceroute ignores -m always
  • Confusing hops with IP resolution count
5. You want to trace the path to example.com but skip hostname lookups and limit hops to 4. Which command achieves this?
hard
A. traceroute -m 4 -h example.com
B. traceroute -n -m 4 example.com
C. traceroute --no-hostname --max-hops=4 example.com
D. traceroute -4 -n example.com

Solution

  1. Step 1: Identify options for skipping hostname and limiting hops

    -n skips hostname lookup; -m 4 limits hops to 4.
  2. Step 2: Verify option correctness and order

    traceroute -n -m 4 example.com uses both correctly. traceroute -m 4 -h example.com uses invalid -h. traceroute --no-hostname --max-hops=4 example.com uses non-standard options. traceroute -4 -n example.com limits to IPv4 but not hops.
  3. Final Answer:

    traceroute -n -m 4 example.com -> Option B
  4. Quick Check:

    -n and -m 4 combined = correct command [OK]
Hint: Combine -n and -m for no hostname and hop limit [OK]
Common Mistakes:
  • Using -h instead of -m for hops
  • Assuming --no-hostname is valid
  • Confusing -4 (IPv4) with hop limit
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard