TransWikia.com

How to trace the routes to all hosts in a subnet?

Super User Asked by uggla on December 5, 2021

I am trying to trace the routes to all live hosts in a subnet. How would one design the command? I’ve tried the commands below, to no avail. Man pages does not make me any wiser.

mtr -c 1 --report 10.10.16.X
mtr -c 1 --report 10.10.16.0/24

traceroute 10.10.16.X
traceroute 10.10.16.0/24

One Answer

There is no such thing available. Almost always all IPs in same block are using same routes (typical routing works with subnet masks).

In Linux, you can use short script, for example

for i in $(seq 1 255); do
 traceroute 10.10.16.$i
done

This prints route to each address, and do not include any comparing functions to detect different routes to different addresses.

Answered by Olli on December 5, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP