linux内网机器如何查看本地外网ip

参考自:http://www.gaojinbo.com/linux%E5%86%85%E7%BD%91ip%E7%9A%84%E6%9C%BA%E5%99%A8%E5%A6%82%E4%BD%95%E6%9F%A5%E7%9C%8B%E6%9C%AC%E5%9C%B0%E5%A4%96%E7%BD%91ip.html


非常简单,下面一条命令搞定

curl ifconfig.me

完成!


更多命令以及返回结果如下:

Command Line Interface

$ curl ifconfig.me 221.7.252.66
$ curl ifconfig.me/ip 221.7.252.66
$ curl ifconfig.me/host  
$ curl ifconfig.me/ua Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.79 Safari/535.11 QIHU THEWORLD
$ curl ifconfig.me/port 31255
$ curl ifconfig.me/lang zh-CN,zh;q=0.8
$ curl ifconfig.me/keepalive  
$ curl ifconfig.me/connection keep-alive
$ curl ifconfig.me/encoding gzip,deflate,sdch
$ curl ifconfig.me/mime text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
$ curl ifconfig.me/charset GBK,utf-8;q=0.7,*;q=0.3
$ curl ifconfig.me/via  
$ curl ifconfig.me/forwarded  
$ curl ifconfig.me/all ip_addr: 221.7.252.66
remote_host: 
user_agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.79 Safari/535.11 QIHU THEWORLD
port: 31255
lang: zh-CN,zh;q=0.8
connection: keep-alive
keep_alive: 
encoding: gzip,deflate,sdch
mime: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
charset: GBK,utf-8;q=0.7,*;q=0.3
via: 
forwarded: 
$ curl ifconfig.me/all.xml <info>
    <charset>GBK,utf-8;q=0.7,*;q=0.3</charset>
    <connection>keep-alive</connection>
    <encoding>gzip,deflate,sdch</encoding>
    <forwarded></forwarded>
    <ip_addr>221.7.252.66</ip_addr>
    <keep_alive></keep_alive>
    <lang>zh-CN,zh;q=0.8</lang>
    <mime>text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</mime>
    <port>31255</port>
    <remote_host></remote_host>
    <user_agent>Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.79 Safari/535.11 QIHU THEWORLD</user_agent>
    <via></via>
</info>
$ curl ifconfig.me/all.json {"connection":"keep-alive","ip_addr":"221.7.252.66","lang":"zh-CN,zh;q=0.8","remote_host":"","user_agent":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.79 Safari/535.11 QIHU THEWORLD","charset":"GBK,utf-8;q=0.7,*;q=0.3","port":"31255","via":"","forwarded":"","mime":"text/html,application/x

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值