背景
平時我們在使用Linux服務器的時候,經常都是遠程終端命令行去使用Linux服務器,而在服務器上有時候需要調用第三方服務,而第三方服務又有IP白名單限制,這就需要我們將我們自己的公網IP報給第三方進行白名單設置,這時候我們又不能像使用Windows那樣去百度IP,自動檢測我們的外網IP,那要怎麼辦呢?
小妙招
其實這個使用,我們依舊可以用命令去通過一些網站獲取外網IP,直接使用下面命令
curl ifconfig.me
curl cip.cc
curl icanhazip.com
curl ident.me
curl ipecho.net/plain
curl whatismyip.akamai.com
curl tnx.nl/ip
curl myip.dnsomatic.com
curl ip.appspot.com
curl -s checkip.dyndns.org | sed 's/.*IP Address: \([0-9\.]*\).*/\1/g'
https://whatismyipaddress.com/
https://www.ipaddress.com/
國內常見的還有
https://www.ip138.com
https://ip.bmcx.com/
https://www.ip111.cn/
https://www.ip131.com/
https://ip.265o.com/
https://toolin.cn/ipaddr
https://www.webidc.pw/
https://ip.900cha.com/
http://tools.fuwuce.com/ip/
http://www.chaipip.com