现在很多云主机都是使用 nat,没有在机器上直接添加外网 IP 了。这时候要获取到外网 IP 就需要一些服务的支持。那么有哪些网站可以获取到呢?
以下的一些站点都可以获取到机器上访问的外网IP地址。
IPIP.NET
IPCN
搜狐
IP138
Ping, mtr, dig and TCP port check from multiple locations
icanhazip.com
Comprehensive IP address data, IP geolocation API and database - IPinfo.io
在服务器终端下通过以下命令查看的
curl https://ip.cn
curl http://pv.sohu.com/cityjson 2>> /dev/null | awk -F '"' '{print $4}'
curl icanhazip.com
curl ipv4.icanhazip.com
curl ipinfo.io/ip
curl ip.sb