How to Get Client Computer next hop,Not the gateway

Now the problem is we have 8000 PCs with IP address starts with “10.”, and cut this whole IP section into hundreds of subnet to recognize there physical location,but some staff connect there PCs into private router and PCs are allocated a private IP start with 192 or 172,so with this IP address,I can not get there physical location with IP address.
so can anybody tell me how to get these PCs’ next hop IP adress,then I can get there physical location by next hop.
Note, I mean next hop is after the Gateway.

thanks

You can probably achieve that using a trace route tool:

  • tracert on Windows ( e.g. tracert 208.67.222.222 -h 3 )
  • traceroute on Linux ( e.g. traceroute 208.67.222.222 -m 3 )

You can specify also the maximum number of hops ( -h for tracert and -m for traceroute).
If you have a BES client on every PC with the 192 address you can create a task to run the command on every client. The task can append the result in a file and using a custom computer property you can report it to the Console/WebReports. Of course you need to parse the result to find the first line with a 10.x.x.x IP or something like that.

thanks, I know this way,but I mean Use Fixlet code,not the third-part tools,beause I need use Fixlet to make client be relevant.

Your are welcome boltkiller,
You can use the relevance to read the content of the file created by the task but you still need to run a custom task to create the file. The traceroute and tracert commands are embedded in all unix/windows OSs.

For example you can put in the actionscript o the task:

if {windows of operating system}
wait tracert 208.67.222.222 -h 3 > C:\tracert.txt
endif

if {unix of operating system} wait traceroute 208.67.222.222 -m 3 > /traceroute.txt endif

Then in the relevance or whatever Fixlet you can use:

if exists file “C:\tracert.txt” then exists lines whose ( it as string contains “10.x.x.x” ) of file “C:\tracert.txt” else false

and as second condition:

if exists file "/traceroute.txt" then exists lines whose ( it as string contains "10.x.x.x" ) of file "/traceroute.txt" else false

Of course you need to replace “10.x.x.x” with the wanted IP.
I hope this will help.

1 Like

Thanks for your warm-hearted answer,I think this must be the best way. Thanks again.

boltkiller from China.