Linux——Linux系统命令行获取公网IP的方法

今天介绍一些查看linux系统公网IP的方法

1.通过访问ipconfig.co来查看。

命令行如下:

#更多用法访问ifconfig.co
wget -qO - ifconfig.co

2.通过curl来获取IP

如果没有curl,要先下载安装curl

sudo yum install curl

其次,使用下列命令中得一个来获取本地地址:

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
 

用x-shel连接阿里云ESC服务器键入命令试一试:

也可以查看ip和地区

#返回IP和地区
curl ip.6655.com/ip.aspx?area=1
curl cip.cc

试一试 

好啦,以上就是通过命令行获取系统公网IP的方法,大家可以试一试~

BIU~

猜你喜欢

转载自blog.csdn.net/Searchin_R/article/details/83833034