Hello,
I need to get the DSL-Modem’s IP to use it in various curl commands.
By default its IP is given 192.168.1.1 but user as admin can change this IP, so I must fetch it.
Well I could use DNS method to get it but I’d prefer to don’t rely on it
Among various method, I thought to “traceroute” towards a reference site (ISP’s site for example) because this gives the name and IP of the gateway (so the router) in first instance.
If I use “Traceroute macscripter.net” from “Network utilities” provided with OS X, it’s rather instantaneous, and returns the full nodes list
If I try to do it (using defaults parameters) via a command Shell
do shell script “traceroute macscripter.net” it’s just endless !! Must force to quit
To make it useful, I try only 3 hops (I can even make it faster by using -q and -w options)
do shell script "traceroute -m 3 macscripter.net"
I retrieve only
1 /ModemName/ (192.168.1.1) 0.859 ms
2 * * *
3 * * *
I can’t never get the second and third routing IP address.
My question is : what happens if, instead, there is a router between the DSL Modem-Router and the Mac?
can I expect to retrieve only the first node’s IP or at least the two LAN Router’s IP?
Another way to retrieve fast and accurately the Modem’s IP?