If you are behind a NAT router or firewall and if you need to know the external IP address on a UNIX or Linux workstation, the below one liners may be of help.
The following commands will output the external IP address in plain text.
1 |
$ curl http://ifconfig.me/ |
1 |
$ curl http://ipecho.net/plain |
1 |
$ wget -qO - http://ifconfig.me/ |
1 |
$ wget -qO - http://ipecho.net/plain |
For an external IP address wrapped in HTML, try these commands.
1 |
$ curl http://checkip.dyndns.org/ |
1 |
$ wget -qO - http://checkip.dyndns.org/ |
To get the external IPs from a Windows machine, run the commands from a Cygwin shell terminal.