1

My router has a WAN PRIVATE IP address which is assigned via DHCP by my ISP. This is different from my public IP address of course.

In my router settings page I can read it: 10.245.134.71, and gateway IP is 10.245.122.1.

How can I get to know this IP (while connected to my router via LAN) without having to open the router settings page?

I am looking for a shell command to show the IP in red.

scheme of my network

If I perform a tracert it doesn't show:

tracert 8.8.8.8

  1     4 ms    <1 ms    10 ms  dsldevice.lan [192.168.1.254] <-- I don't need this one
  2    17 ms    17 ms    19 ms  10.245.122.1  <-- the actual gateway
  3    22 ms    18 ms    17 ms  10.21.107.254

etc etc

tracert 10.245.134.71

  1     1 ms     5 ms     3 ms  dsldevice.lan [10.245.134.71] <-- This one! but how to get?

tracert dsldevice.lan

  1     1 ms     7 ms    <1 ms  dsldevice.lan [192.168.1.254]
  • 1
    That may unfortunately be impossible. You should try to scrape the router’s status page. – Daniel B Dec 19 '15 at 11:14
  • First you are mentioning 10.245.134.71 which is on the picture too and there is 10.245.134.61 in tracert which you want to get?!? ;) – g2mk Dec 19 '15 at 16:57
  • it has changed (it is dynamic) this is the reason why I am looking for a smarter way to get it, anyway, I'll correct it – dioporco Dec 19 '15 at 16:59
0

Speak to your ISP. Unless they have a service (like dynamic ip management for internal use you can clip onto) you are out of luck.

Your alternatives are - 1. Scrape the router page (curl could do this) 2. Set up your own dynamic dns system if the router supports it - and the dynamic dns server is in the same network or maps ip based on what router says rather then discovering it. 3. Get rid of the router and configure your box in its place. 4. Bypass the need to know the internal IP by overlaying a vpn.

  • thank you for the answer but.. come on if I tracert 10.245.134.71 it responds! There must be simpler a way! – dioporco Dec 19 '15 at 20:24
  • Ofcourse it responds. That doesnt mean its discoverable. The problem us that its bound to the EXTERNAL interface so discovery from lan wont work becausevARP requests dont traverse routers. – davidgo Dec 19 '15 at 20:29
0

Yes! It's very possible. Get a splitter, use the black ports to connect the router to the modem, and then connect your computer to the yellow port. Open up wireshark and you're done.

If you only have one ethernet port and you still want to be connected to the internet, use an Ethernet-to-USB adapter so that you can be connected to the internet on eth0, but still have the WAN private IP available from the terminal by sniffing eth1 (Wireshark has command line options so you can write a shell script to pull the IP easily).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.