首頁  >  文章  >  系統教程  >  取得CentOS命令列中的公網IP位址的方法

取得CentOS命令列中的公網IP位址的方法

王林
王林轉載
2024-01-02 22:28:311123瀏覽

最近本地配置了伺服器,使用了家用的頻寬沒有固定的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   ###

以上是取得CentOS命令列中的公網IP位址的方法的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:jb51.net。如有侵權,請聯絡admin@php.cn刪除