快速查看本机公网IP的几种方法

ifconfig.me

链接: https://ifconfig.me/

快速查看本机公网IP的几种方法_第1张图片

命令行

$ curl ifconfig.me	⇒	61.48.208.*
$ curl ifconfig.me/ip	⇒	61.48.208.*
$ curl ifconfig.me/ua	⇒	Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36
$ curl ifconfig.me/lang	⇒	zh-CN,zh;q=0.9
$ curl ifconfig.me/encoding	⇒	
$ curl ifconfig.me/mime	⇒	text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
$ curl ifconfig.me/charset	⇒	
$ curl ifconfig.me/forwarded	⇒	61.48.208.*
$ curl ifconfig.me/all	⇒	ip_addr: 61.48.208.*
remote_host: unavailable
user_agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36
port: 44032
language: zh-CN,zh;q=0.9
referer:
connection:
keep_alive:
method: GET
encoding:
mime: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
charset:
via: 1.1 google
forwarded: 61.48.208.*
$ curl ifconfig.me/all.json	⇒	{"ip_addr":"61.48.208.*","remote_host":"unavailable","user_agent":"Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36","port":44032,"language":"zh-CN,zh;q=0.9","method":"GET","mime":"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","via":"1.1 google","forwarded":"61.48.208.*"}

ifconfig.io

链接: https://ifconfig.io/

快速查看本机公网IP的几种方法_第2张图片

命令行

$ curl ifconfig.io 
61.48.208.*
$ curl ifconfig.io/ip
61.48.208.*
$ curl ifconfig.io/host
61.48.208.*
$ curl ifconfig.io/country_code
CN
$ curl ifconfig.io/ua
Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36
$ curl ifconfig.io/port
12234
$ curl ifconfig.io/lang
zh-CN,zh;q=0.9
$ curl ifconfig.io/encoding
gzip
$ curl ifconfig.io/mime
text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
$ curl ifconfig.io/forwarded
61.48.208.*
$ curl ifconfig.io/all
$ curl ifconfig.io/all.xml
$ curl ifconfig.io/all.json
$ curl ifconfig.io/all.js

ifconfig.co

链接:https://ifconfig.co/

快速查看本机公网IP的几种方法_第3张图片

命令行

$ curl ifconfig.co/
61.48.208.*

ipinfo.io

链接:https://ipinfo.io/

快速查看本机公网IP的几种方法_第4张图片

命令行

$ curl -s https://ipinfo.io/
{
  "ip": "61.48.208.*",
  "city": "Beijing",
  "region": "Beijing",
  "country": "CN",
  "loc": "39.*,116.*",
  "org": "AS4808 China Unicom Beijing Province Network",
  "timezone": "Asia/Shanghai",
  "readme": "https://ipinfo.io/missingauth"
}

【完】

你可能感兴趣的:(#,curl,网络)