获取本机出口IP方法

Windows 浏览器常用方式访问:

  1、http://www.ip138.com/

  

  2、http://tool.chinaz.com/

  3、在百度搜索框内输入 ip  会自动识别出来当前的出口IP

Linux 命令行接口获取方式:

  1、https://ipinfo.io/

[root@test ~]# curl ipinfo.io
{
  "ip": "xxx.18.xx.1xx",
  "city": "",
  "region": "Guangdong",
  "country": "CN",
  "loc": "2xx.xx,1xx.xx0",
  "org": "AS134774 CHINANET Guangdong province Shenzhen MAN network"
}

  2、https://ip.cn/

[root@test ~]# curl ip.cn
当前 IP:xx.18.96.1xx 来自:广东省深圳市 电信

  

  3、http://www.cip.cc/

[root@test ~]# curl cip.cc
IP    : xxx.18.xx.1x4
地址    : 中国  广东  深圳
运营商    : 电信

数据二    : 广东省深圳市 | 电信

数据三    : 中国广东省深圳市 | 电信

URL    : http://www.cip.cc/xx8.18.xx.1xx

  4、http://myip.ipip.net/

[root@test ~]# curl myip.ipip.net
当前 IP:xx.18.xx.x4x  来自于:中国 广东 深圳  电信

  5、http://ifconfig.me/

[root@test ~]# curl ifconfig.me
2xx.18.xx.x4

  6、http://members.3322.org/dyndns/getip

[root@test ~]# curl members.3322.org/dyndns/getip
xx.18.xx.x4

以上Linux方式获取ip出口地址部分通过浏览器访问可以获得更详细的信息。

本文参考:https://blog.csdn.net/orangleliu/article/details/51994513

原文地址:https://www.cnblogs.com/chenjinxi/p/9815200.html