您的当前位置:首页 --> CentOS入门
CentOS从命令行获取公网IP的方法
浏览次数:856 关键词 ( 公网  命令行  方法  CentOS  )

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

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

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

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

[plain] view plaincopy  
  1. sudo yum install curl  
其次,使用下列命令中得一个来获取本地地址: [html] view plaincopy  
  1. curl img/20170809/sbv51kacfnt
  2. curl ip.6655.com/ip.aspx  
  3. curl ifconfig.me  
  4. curl icanhazip.com  
  5. curl ident.me  
  6. curl ipecho.net/plain  
  7. curl whatismyip.akamai.com  
  8. curl myip.dnsomatic.com  
  9.   
  10. #更多用法访问ifconfig.co  
  11. wget -qO - ifconfig.co  
  12.   
  13. #返回IP和地区  
  14. curl ip.6655.com/ip.aspx?area=1  
  15. curl cip.cc  

下一条 centos系统中网络配置相关
上一条 CentOS下添加用户到 sudoers

数千企业与站长的选择,7*24小时稳定运行

 了解更多套餐详细