1. 程式人生 > >用Linux命令列獲取本機外網IP地址

用Linux命令列獲取本機外網IP地址

 $ curl ifconfig.me

[[email protected] ~]# curl ifconfig.me

14.23.92.186


 $ curl icanhazip.com

[[email protected] ~]# curl icanhazip.com

14.23.92.186


 $ curl ident.me

[[email protected] ~]# curl ident.me

14.23.92.186


 $ curl ipecho.net/plain

[[email protected] ~]# curl ipecho.net/plain

14.23.92.186


 $ curl whatismyip.akamai.com

[[email protected] ~]# curl whatismyip.akamai.com

14.23.92.186


 $ curl tnx.nl/ip

[[email protected] ~]# curl tnx.nl/ip

14.23.92.186


 $ curl myip.dnsomatic.com

[[email protected] ~]# curl myip.dnsomatic.com

14.23.92.186


 $ curl ip.appspot.com

[[email protected] ~]# curl ip.appspot.com

curl: (7) couldn't connect to host


 $ curl -s checkip.dyndns.org | sed 's/.*IP Address: \([0-9\.]*\).*/\1/g'

[[email protected] ~]# curl -s checkip.dyndns.org | sed 's/.*IP Address: \([0-9\.]*\).*/\1/g'

14.23.92.186