请选择 进入手机版 | 继续访问电脑版
在线投稿 文字标题 文字标题 文字标题 文字标题 文字标题
切换皮肤
背景
在自己的笔记本上面装Linux,上网一般都是通过wifi上面,不是直接配置外网IP的,有时候连接到远程服务器的时候,需要知道自己的外网IP的哪个,进行添加白名单。
?url=http%3A%2F%2Fdingyue.ws.126.net%2F2020%2F0421%2Fb511a18ej00q943i1000td200hs00hsg00hs00hs.jpg

ifconfig.me
这个网站提供了,对应的api来获取对应的外网IP信息,及请求客户端的信息,可以通过浏览器访问ifconfig.me找到下面的命令帮助,执行对应的curl请求,就可以获取到信息
$ curl ifconfig.me 1.62.24.94
$ curl ifconfig.me/ip 1.62.24.94
$ curl ifconfig.me/host unavailable
$ curl ifconfig.me/ua Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36
$ curl ifconfig.me/port 15294
$ curl ifconfig.me/lang zh-CN,zh;q=0.9,en;q=0.8
$ curl ifconfig.me/keepalive
$ curl ifconfig.me/connection
$ curl ifconfig.me/encoding gzip, deflate, br
$ curl ifconfig.me/mime text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3
$ curl ifconfig.me/charset
$ curl ifconfig.me/via 1.1 google
$ curl ifconfig.me/forwarded 1.62.24.94, 213.62.20.194
$ curl ifconfig.me/all ip_addr: 1.62.24.94
remote_host: unavailable
user_agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36
port: 15294
language: zh-CN,zh;q=0.9,en;q=0.8
referer: https://blog.csdn.net/
connection:
keep_alive:
method: GET
encoding: gzip, deflate, br
mime: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3
charset:
via: 1.1 google
forwarded: 1.62.24.94, 213.62.20.194
$ curl ifconfig.me/all.xml 1.62.24.94 unavailable Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36 15294 zh-CN,zh;q=0.9,en;q=0.8 https://blog.csdn.net/ GET gzip, deflate, br text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3 1.1 google 1.62.24.94, 213.62.20.194
$ curl ifconfig.me/all.json {"ip_addr":"1.62.24.94","remote_host":"unavailable","user_agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36","port":15294,"language":"zh-CN,zh;q=0.9,en;q=0.8","referer":"https://blog.csdn.net/","method":"GET","encoding":"gzip, deflate, br","mime":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3","via":"1.1 google","forwarded":"1.62.24.94, 213.62.20.194"}
?url=http%3A%2F%2Fdingyue.ws.126.net%2F2020%2F0421%2Ff394ef55j00q943i1000pd200hs00a0g00hs00a0.jpg
上面的网址提供的内容虽然很多,但是比较慢,有时候还请求失败,可以使用ip.cn提供的服务进行查询
{"ip": "112.48.22.57", "country": "福建省厦门市", "city": "移动"}

?url=http%3A%2F%2Fdingyue.ws.126.net%2F2020%2F0421%2Fe5480894j00q943i1000pd200hs007ag00hs007a.jpg





回复

使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则


    Archiver|手机版|小黑屋|齐聚无忧 |网站地图

    Powered by Discuz! X3.4  © 2001-2013 Comsenz Inc.