Home > System Tutorial > LINUX > body text

How to obtain the public IP address in the CentOS command line

王林
Release: 2024-01-02 22:28:31
forward
1119 people have browsed it

Recently configured the server locally, using home bandwidth without a fixed IP address. Therefore, you need to obtain your own public IP address.

Since the machine is the server version of CentOS 6.5, there is naturally no way to obtain the public IP address through browser access.

So record some methods of obtaining public IP from the command line.

First, you need to follow curl on the machine:

[plain] view plaincopy

sudo yum install curl Secondly, use one of the following commands to get the local address:

[html] view plaincopy

curl http://members.3322.org/dyndns/getip

curl ip.6655.com/ip.aspx

curl ifconfig.me

curl icanhazip.com

curl ident.me

curl ipecho.net/plain

curl whatismyip.akamai.com

curl myip.dnsomatic.com

#For more usage, visit ifconfig.co

wget -qO - ifconfig.co

#Return IP and region

curl ip.6655.com/ip.aspx?area=1

curl cip.cc

The above is the detailed content of How to obtain the public IP address in the CentOS command line. For more information, please follow other related articles on the PHP Chinese website!

source:jb51.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!