Site icon moneyslow.com

得到服务器出口ip的n个方法

linux干货

linux干货

curl ifconfig.me
curl ip.bsd-unix.net
curl icanhazip.com
curl ipinfo.io/ip
wget -qO- ipinfo.io/ip
lynx -source ipinfo.io/ip
wget -O – -q icanhazip.com
curl -s http://whatismyip.akamai.com/
curl -s https://4.ifcfg.me/
nc 4.ifcfg.me 23 | grep IPv4 | cut -d’ ‘ -f4
telnet 4.ifcfg.me 2>&1 | grep IPv4 | cut -d’ ‘ -f4
echo close | ftp 4.ifcfg.me | awk ‘{print $4; exit}’

下面是个测试各种方法的速度脚本,最后有排名:
wget https://moneyslow.com/bin/externalip-benchmark
chmod a+x externalip-benchmark
./externalip-benchmark

测试结果:

其他文章:

Exit mobile version