hey is there a command by which i can find my external IP.. like of my router or my NAT\DSL Router etc so that i could know it without visiting whatsmyip.net etc
feedback
|
|
There is no built-in command to do this. Part of the problem is that when you are connected to the internet through a router, your network hardware is not directly connected to the internet, so your system isn't specifically assigned an IP. It's possible you might even have multiple external IPs in some cases if you are behind a reverse proxy, as many corporate networks are set up. Your best bet might be to create a script which queries whatismyip.org, or trying to find if one already exists. (As a tip, whatismyip.org is preferable to most other solutions, since it just returns your IP as plain text - no superfluous text, links, images or other garbage. It would be much easier to use in a custom script than most of the other IP-detection sites.) | |||
|
feedback
|
|
grab your own copy of
or grab a copy of
| ||||
|
feedback
|
|
Create a file named
Execute using
As nhinkle noted, it's best to choose a site that only returns the IP and not HTML + ads, etc. like:
(source: http://externip.com/about) | |||
|
feedback
|
|
The script from paradroid worked fine but whatsmyip moved the web page to http://automation.whatismyip.com/n09230945.asp If you change to this, it works perfect. | |||
|
feedback
|
|
It gives you the option to put the IP address in the clipboard and it sets an environmental variable - I no longer do this. I just do this instead:
or...
...to get the current public IP address into the clipbpoard. You need cURL. | ||||
|
feedback
|
|
You can deduce the IP on a simple network by running TRACERT. At a command prompt type tracert www.google.com or another well know web site. You will likely see the first hop is your inside interface(default Gateway) of your router. You should then see the next hop which is the external interface and the IP you are looking for. Works for most simple networks with one router and internal network. | |||||
feedback
|
|
Are you able to log into your router? Should find the info there, like on a Status page. Using a Mozilla browser & NoScript? NoScript Options | Advanced | ABE -> WAN IP. | |||
|
feedback
|