1.获取内网地址(私有地址) ifconfig -a 2.获取外网地址(公网地址) curl members.3322.org/dyndns/getip 转载于:https://www.cnblogs.com/dakewei/p/6882908.html