linux系统下查看服务器IPv4和IPv6公网IP和私网IP

1
ip addr show eth0 | grep inet | awk '{ print $2; }' | sed 's/\/.*$//'