I have access to a server via its local IP (I use putty) and I know the server has a static IP, how can I found its static(fix) IP? Its OS is CentOS.
Asked
Active
Viewed 143 times
0
-
`curl http://canhazip.com/` – ceejayoz Nov 27 '12 at 18:30
-
also: `curl http://wgetip.com/` `curl http://curlmyip.com/` – xofer Nov 27 '12 at 18:33
-
@xofer `jsonip.com` can be handy too. – ceejayoz Nov 27 '12 at 18:40
-
Look at the edge router/firewall configuration? Hit `whatismyip.com` from the server in question? – voretaq7 Nov 27 '12 at 21:25
-
`curl ip.tyk.nu`, `curl ifconfig.me` – Janus Troelsen Feb 18 '15 at 18:20
2 Answers
3
Enter ifconfig
at the command line.

xofer
- 3,072
- 12
- 19
-
Note that ifconfig will show the actual IP address assigned to the network interface, where the external sources listed in comments/answers will show the IP as it appears to, er, those external sources. This may be different in some situations, so check both. – xofer Nov 27 '12 at 18:35
1
For example:
links -dump http://whatismyip.com | egrep "([0-9]+.){3}"
Of course you can use another site, but this is one of most popular.

Tomasz Olszewski
- 898
- 1
- 9
- 20
-
I assumed that there is some kind of NAT, and public IP is not known on host itself – Tomasz Olszewski Nov 27 '12 at 18:32