命令行下查看出口IP(你上网时暴露在公网上的IP地址)

你想知道你的公网IP地址是多少,通常的做法是去百度输入IP就会显示你的公网IP地址和IP归属地,但我今天遇到一个问题:命令下如何查看电脑的公网IP?以下分享解决这个问题的方法。

# curl cip.cc
-------------------------------------------
IP	: 115.148.41.67
地址	: 中国  江西  吉安
运营商	: 电信

数据二	: 江西省吉安市 | 电信

数据三	: 中国江西省吉安市 | 电信

URL	: http://www.cip.cc/115.148.41.67
# curl ipinfo.io
-------------------------------------------
{
  "ip": "115.148.41.67",
  "city": "Tiantuo",
  "region": "Jiangxi",
  "country": "CN",
  "loc": "26.8994,116.5700",
  "org": "AS4134 CHINANET-BACKBONE"
}
# curl myip.ipip.net
-------------------------------------------
当前 IP:115.148.41.67  来自于:中国 江西 吉安  电信
# curl ifconfig.me
-------------------------------------------
115.148.41.67
# curl ifconfig.io
-------------------------------------------
115.148.41.67
# curl httpbin.org/ip
-------------------------------------------
{
  "origin": "115.148.41.67, 115.148.41.67"
}
# curl http://members.3322.org/dyndns/getip
-------------------------------------------
115.148.41.67

PS:当然还有一些其他网站也提供相关服务,以上是我使用过的几个命令。

发布了18 篇原创文章 · 获赞 8 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/leigin/article/details/92796665