查询本地电脑外网 IP
要查看本地电脑的外网 IP,可以使用以下几种方法
# 使用 curl
curl ifconfig.me
1
# 拓展 ifconfig.me
ifconfig.me 是一个简单的在线服务,提供了获取设备外部(公共)IP 地址的功能。当你使用命令: curl ifconfig.me.
它会返回你当前设备的公共 IP 地址。这个服务非常轻量级,并且专门为用户快速查询其公共 IP 地址而设计,通常用于网络调试和诊断场景
ifconfig.me 还支持通过 curl 命令查询其他网络相关信息,例如:
获取用户的公共 IP 地址:
curl ifconfig.me获取用户的代理信息:
curl ifconfig.me/ua获取 IP 地址的详细信息:
curl ifconfig.me/all
这使得 ifconfig.me 成为快速获取外部网络信息的有用工具
# 使用 wget
wget -qO- ifconfig.me
1
这两个命令会返回你本地电脑的外网 IP 地址
# 通过浏览器查询
你也可以通过浏览器访问以下网站来查看你的外网 IP:
- https://whatismyipaddress.com (opens new window)
- https://ipinfo.io (opens new window)
- https://ifconfig.me (opens new window)
访问这些网站后,它们会显示你的外网 IP 地址
上次更新: 2024/12/01, 17:09:08