外部ネットワークのIPアドレスを表示するLinuxサーバーコマンド

外部ネットワークのIPアドレスを表示するLinuxサーバーコマンド

カールプレーンテキスト形式の出力:
1、curl cip.cc 
2、curl icanhazip.com 
3、curl ident.me 
4、curl ipecho.net/plain 
5、curl whatismyip.akamai.com 
6、curl tnx.nl/ip 
7 curl myip.dnsomatic.com 
8、curl ifconfig.me 
9、curl ip.appspot.com 
10、curl curlmyip.com 
11、curl www.trackip.net/i 
12、curl ipinfo.io/ip 
13、curl -s checkip .dyndns.org | sed's /.* IPアドレス:\([0-9 \。] * \)。* / \ 1 / g '


bashスクリプトの例:

#!/ bin / bash 
PUBLIC_IP = `wget http://ipecho.net/plain -O --- q; echo` 
echo $ PUBLIC_IP

おすすめ

転載: blog.51cto.com/meiling/2607090