Linux下获取本地出口IP

1
2
3
4
5
> curl ifconfig.me

> curl http://members.3322.org/dyndns/getip

> curl ip.cn

ifconfig.me 的域名很好记, 但是在国内的访问速度可能极其缓慢

ip.cn 域名也很好记, 在国内返回结果的速度也很快, 而且还能返回运营商的信息

1
2
➜  ~ curl ip.cn
当前 IP:209.9.108.86 来自:香港特别行政区