1

enter image description here

I am on double NAT (behind 2 routers).

I known how to get the public IP by visiting some webpages or use dig command. Yes I known WAN IP usually same as the public IP. I talk about WAN IP #2 that can be a private IP. I tried tracert and pathping commands but didn't work. Maybe we can't known the WAN IP by general way. But I saw one IP camera app can find it. Maybe it's "tinyCam Monitor" on android.

  • 1
    Hi @Boontawee Home. the question would benefit from additional clarifications. For example, you said `I known how to get the public IP by visiting some webpages` what do you mean by that? What commands did you try? Additional clarifications may help us to analyze your problem more accuratly! –  Sep 22 '18 at 13:44
  • Pub IP or WAN IP #1 can easy check by many ways eg. whatismyip.com or use command dig. Maybe it can't know WAN IP by general way. – Boontawee Home Sep 22 '18 at 14:18
  • 1
    Possible duplicate of [What's the shortest way to find my WAN IP address at the command line?](https://unix.stackexchange.com/questions/178268/whats-the-shortest-way-to-find-my-wan-ip-address-at-the-command-line) –  Sep 22 '18 at 14:18
  • 1
    I think you'd need some client on that address space... or a STUN service running on the "internal" WAN – RubberStamp Sep 22 '18 at 14:19
  • 2
    Do you know any details about the first NAT router? Also, `tracert` and `pathping` are Windows commands. Is there a Linux host on LAN with private range 2? AFAIK, `tracert` uses UDP packets; you may try `tcptraceroute` for TCP packets or `mtr` for ICMP packets, in the case the NAT router treats them differently. Some routers also offer an UPnP interface to sidestap NATing; you could try that as well. – dirkt Sep 22 '18 at 16:03
  • 1
    There is no general way to find out the address WAN IP2. Why would you need that address? – RalfFriedl Sep 22 '18 at 18:17
  • I am learning about network and making some IP camera software. In some case user can't access on router #1 eg: ISP or their company. I would like to have a function to check that user is on double NAT or single NAT. To check WAN IP by visit some webpage eg: whatismyip.com is one of the solutions to compare the result. I think external IP (WAN IP) can access via uPnP enabled routers. I need to learn practical of UPnP/IGD. Hope someone can teach me the command line. – Boontawee Home Sep 23 '18 at 15:09
  • Update!... MiniUPnP can show external IP on uPnP enabled routers. – Boontawee Home Sep 23 '18 at 15:27
  • ...and if you have UPnP enabled on your gateway router you get what you deserve. – roaima Sep 24 '18 at 08:54

1 Answers1

0

enter image description here

Private LAN clients can known external IP only when the router enabled uPnP

I had recheck the android app "tinyCam Monitor". She known the external IP when router is enabled uPnP feature.

So I check around internet and found MiniUPnP (http://miniupnp.free.fr/) command that can show the external IP via UPnP/IGD. I don't know much about UPnP/IGD.

Old routers notes

UPnP implementations are potentially subject to security breaches. Badly implemented or configured UPnP IGDs are vulnerable. Security researcher HD Moore did a good work to reveal vulnerabilities in existing implementations : Security Flaws in Universal Plug and Play (PDF). A common problem is to let SSDP or HTTP/SOAP ports open to the internet : they should be only reachable from the LAN.

  • 1
    To make this a useful answer, at least describe how you used MiniUPnP, what your particular router showed when using it, and what brand and model of router it is - things will likely work differently for other routers. – dirkt Sep 23 '18 at 16:18