Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

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 stackoverflow.com Sep 2 '11 at 7:18

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

add comment

5 Answers 5

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
3  
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 whatismyip.com. –  Feynman Feb 14 '12 at 1:16
add comment

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 - whatismyip.org
share|improve this answer
add comment

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
add comment

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
add comment

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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