查看当前网络的外网IP
9527
L227
2015-09-27 07:41
8回复
4773查看
#国内某网站的接口,只返回IP
curl ip.6655.com/ip.aspx
curl whatismyip.akamai.com
#更多用法访问ifconfig.co
wget -qO - ifconfig.co

curl icanhazip.com
dig +short myip.opendns.com @resolver1.opendns.com

curl ident.me
curl v4.ident.me
curl v6.ident.me
#慢
curl curlmyip.com 
curl ifconfig.me
curl inet-ip.info


#返回IP和地区
curl ip.6655.com/ip.aspx?area=1
curl ip.cn
curl cip.cc


#需要翻墙,只返回IP
curl ip.appspot.com

#参考 http://unix.stackexchange.com/questions/22615/how-can-i-get-my-external-ip-address-in-bash
#有人给了以下测试方法

wget https://raw.githubusercontent.com/rsp/scripts/master/externalip-benchmark
chmod a+x externalip-benchmark
./externalip-benchmark
全部回复 (8)
倒序
石头山
L382
2015-09-28 03:59

在实验环境可以吗?

9527
L227
2015-09-28 04:08

不能访问外网的肯定不行。

此帐号已弃用
L21
2015-10-16 06:36
curl ipinfo.io

--> 详情

Feeennng
L1
2015-12-06 12:58

发现你学的好杂。。什么语言都学

9527
L227
2015-12-07 01:37

只是刷的。最近比较专注地学了python.

Feeennng
L1
2015-12-11 10:05

...好吧

Feeennng
L1
2015-12-11 10:05

...好吧

hellen
L3
2018-09-21 06:57

你好,你返回的这个是你本地dns的外网ip吗,即local dns 的出口ip?

加载中...