Junior — Middle
How is route tracing performed in Linux using tracert or similar commands?
sobes.tech AI
Answer from AI
In Linux, the traceroute command is used to trace the route to a remote host (similar to Windows tracert). It shows the sequence of intermediate routers (hops) that packets pass through.
Working principle:
traceroutesends packets with gradually increasing TTL (Time To Live) values.- Each router decreases TTL by 1, and if TTL reaches 0, it sends back an ICMP "Time Exceeded" message.
- By receiving these messages,
traceroutedetermines the addresses of intermediate nodes and the time to reach them.
Example usage:
traceroute example.com
The output will show a list of routers with the response time to each.
If traceroute is not installed, you can use tracepath or mtr for similar functionality.