CentOS如何从命令行获取公网IP

  发布时间:2017-01-22 16:08:35   作者:佚名   我要评论
一些朋友再问CentOS如何从命令行获取公网IP?下面小编将为大家带来的是CentOS从命令行获取公网IP的方法;希望能够帮助到大家,有需要的朋友一起去看看吧
(福利推荐:【腾讯云】服务器最新限时优惠活动,云服务器1核2G仅99元/年、2核4G仅768元/3年,立即抢购>>>:9i0i.cn/qcloud

(福利推荐:你还在原价购买阿里云服务器?现在阿里云0.8折限时抢购活动来啦!4核8G企业云服务器仅2998元/3年,立即抢购>>>:9i0i.cn/aliyun

最近本地配置了服务器,使用了家用的带宽没有固定的IP地址。因此,需要获取到自己的公网IP地址。

机器是CentOS 6.5的服务器版本自然就没有办法通过浏览器访问的方式获取到公网IP地址。

因此记录一些从命令行获取公网IP的方法。

首先,需要在机器上按照curl:

[plain] view plaincopy

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

[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     

#更多用法访问ifconfig.co  

wget -qO - ifconfig.co     

#返回IP和地区  

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

curl cip.cc  

相关文章

最新评论

?


http://www.vxiaotou.com