Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was wondering if there was a way to find out your router's ip address without using a website like

I searched around, and I am beginning to think it is impossible. If that is the case, could someone explain why?

share|improve this question

migrated from Sep 2 '11 at 7:18

This question came from our site for professional and enthusiast programmers.

up vote 2 down vote accepted
  • Sometime the device will provide a web interface (common with small home devices like Cable Modems) where this kind of information can be found and/or configured.
  • You may be able to make a command-line connection to the device using telnet or ssh, then use /sbin/ifconfig or the local equivalent.
share|improve this answer
Just wanted to add that in your routers web interface config page it'll usually be referred to as your WAN or Public IP Address. – mwan100 Sep 2 '11 at 1:40
I will add that you can get more information with a "dig localhost". This seems to give me the ip address of my nameserver rather than what shows up on – Alex Eftimiades Feb 14 '12 at 1:16

You want to know how are you being seen from outside, so to do this you need to use some outside service.

Note, that it does not have to be just your router WAN address. If you are using http proxy for example the result can by an IP of host many hoops away from your router.

There are several sites with such service. Most is HTTP based, for convenience.

If you need to do it from terminal, you can:

wget -q -O -
share|improve this answer

in addition to dmckee's answer, you may even be able to query the device using snmp, although it usually needs some setting up and isnt particually user-friendly.

share|improve this answer

Most routers support reading (and sometimes even writing) status information and further configuration options via uPnP. One of the information you can get via uPnP is the external IP address assigned to the router.

I don't know which uPnP clients are available for Linux but it may be worth a try...

share|improve this answer

with some routers you can do a "get" on their admin interface somehow, and buried in the HTML will be the external IP address.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .