I re-edit to simplify my question. My computer’s IP address is and the router/gateway's IP is (internal IP). I'm trying to find the external IP of my gateway or router. The router is connected to the ISP and id doesn't have a public IP, so that external IP should be a private IP. How can I find that external private IP?

  • 1
    so www.ifconfig.me/ip isn't what you want? – barlop Jun 3 '13 at 11:17
  • Try with traceroute (or hping in traceroute mode). With a bit of luck, you will see an answer from a private IP just before the connection enters the Internet, and that IP will be the one of the outside router. – LSerni Jun 3 '13 at 11:19
  • The router itself doesn't have the IP, A NI of the Router has an IP(and not a switches NI ports). On the LAN side of a home router, is a switch, just one IP On the other side, if it's connected to your ISP it must be a WAN that end.. It's not designed for a LAN to be connected there. I haven't used more advanced routers though that allow LANs there, but if you're connected to your ISP, it's not designed to have a LAN there. It's meant to either connect straight to the wall(if the socket in your "home router" there is a telephone socket),(cont) – barlop Jun 3 '13 at 12:35
  • or straight to a modem, if the socket is an ethernet/RJ45 socket labelled WAN. – barlop Jun 3 '13 at 12:36
  • I think if it could connect a LAN on that side, then the Router's Administration IP(don't know what NI that'd be associated with), but that's show you the IPs of any port. On a regular home router, you have the switch ports which don't have IPs(the computers on them do). and the other side has an interface which gets an IP, but if it was a more professional router then that interface could be given an IP by the Router, and then, it'd show you what IP it is being given But also, even my home router tells me my internet ip address. If it was sent a private one(theoretically) it'd display that. – barlop Jun 3 '13 at 12:40

Try http://www.whatismyip.com/

This is what I always use when I need this info but cant access the modem.

  • This won't help if the ISP is your gateway to the internet. For me whatismyip.com returns something like, but my routers IP is actually This is because my ISP is running it's own NAT. – jnovacho Feb 13 '17 at 9:52

I believe you are looking for the IP between the modem and the ISP, i.e. the external IP of the modem, not the external IP the router (The router is connected to the modem, perhaps in your case its internal). This isn't possible from your computer (traceroute will give you the private address), but you have a couple of choices.

1) Go to your default gateway on a browser and see if the WAN's private/CGN address is there.

2) Call your ISP (If you can get someone to ping your modem, you may have the same success as this guy)

3) Get a cable splitter* (may be illegal, but I mean if you don't go reading your neighbors stuff doesn't really matter, websites will always use https for sensitive information anyway), and then get a modem for that cable to turn it into ethernet, and then sniff that ethernet.

*Make sure the splitter/tap is read-only, and that the write port is plugged into your actual modem / wall cable!


As you are looking for External IP of modem instead of IP address of router. So you can visit at http://whatsmyrouterip.com/, as whenever I have an issue related to IP I visit the website.


I have the same question as yours, after searching for a long time I found this answer:

# debian/ubuntu setup: 
# sudo apt-get install miniupnpc

# get WAN IP address from UPNP router:
upnpc -s | grep ^ExternalIPAddress | cut -c21-

This works when you are behind a NAT Router with UPNP. Try this and comment on me if it doesn't work :)

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.