How does CentOS obtain the public IP address from the command line?
Recently, the server is configured locally and the home bandwidth does not have a fixed IP address. Therefore, you must obtain your own public IP address.
The server version of CentOS 6.5 is naturally unable to obtain the public IP address through browser access.
Therefore, record some methods for getting public IP addresses from the command line.
First, you need to follow the curl on the machine:
[Plain] view plaincopy
- Sudoyuminstallcurl
Use one of the following commands to obtain the local address: [html] view plaincopy
- Curlhttp: // members.3322.org/dyndns/getip
- Curlip.6655.com/ip.aspx
- Curlifconfig. me
- Curlicanhazip.com
- Cursponent. me
- Curlipecho.net/plain
- Curlwhatismyip.akamai.com
- Curlmyip.dnsomatic.com
- # More methods to access ifconfig. co
- Wget-qO-ifconfig.co
- # Return IP address and region
- Curlip.6655.com/ip.aspx? Area = 1
- Curlcip. cc