CentOS如何从命令行获取公网IP
<p>最近本地配置了服务器,使用了家用的带宽没有固定的IP地址。因此,需要获取到自己的公网IP地址。</p><p>机器是CentOS 6.5的服务器版本自然就没有办法通过浏览器访问的方式获取到公网IP地址。</p>
<p>因此记录一些从命令行获取公网IP的方法。</p>
<p><strong>首先,需要在机器上按照curl:</strong></p>
<p><strong></strong> view plaincopy </p>
<p>sudo yum install curl 其次,使用下列命令中得一个来获取本地地址: </p>
<p><strong></strong> view plaincopy </p>
<p>curl http://members.3322.org/dyndns/getip </p>
<p>curl ip.6655.com/ip.aspx </p>
<p>curl ifconfig.me </p>
<p>curl icanhazip.com </p>
<p>curl ident.me </p>
<p>curl ipecho.net/plain </p>
<p>curl whatismyip.akamai.com </p>
<p>curl myip.dnsomatic.com </p>
<p>#更多用法访问ifconfig.co </p>
<p>wget -qO - ifconfig.co </p>
<p>#返回IP和地区 </p>
<p>curl ip.6655.com/ip.aspx?area=1 </p>
<p>curl cip.cc </p>
頁:
[1]