您的位置:首页 > 运维架构 > Shell

shell中用curl获取外网ip地址

2010-04-21 22:34 411 查看
要获取NAT之后的外网IP地址,可以用浏览器打开www.ip138.com。如果在shell里,可以用下面的方法:

$
curl ifconfig.me


$ curl ifconfig.me
$ curl ifconfig.me/ip
$ curl ifconfig.me/host
$ curl ifconfig.me/ua
$ curl ifconfig.me/port
$ curl ifconfig.me/lang
$ curl ifconfig.me/keepalive
$ curl ifconfig.me/connection
$ curl ifconfig.me/encoding
$ curl ifconfig.me/mime
$ curl ifconfig.me/charset
$ curl ifconfig.me/via
$ curl ifconfig.me/forwarded
如果想知道怎么做到的,猛击这里:http://ifconfig.me/

转载自http://www.commandlinefu.com
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: