windows 下可以通过访问ip138.com来获取本地网络的外网ip地址;
linux 下可以通过curl命令来获取;
具体的方法如下:
curl http://members.3322.org/dyndns/getip
curl http://icanhazip.com/
访问后,会得到一个ip地址,这个IP就是你的外网IP地址。