获取本机ipv6地址,最简单的方法:
cat /proc/net/if_inet6
还可以使用python的netinterface
包。
ifconfig
也是从这个文件进行获取的,只是优化了一下格式。
reference
- https://blog.lilydjwg.me/2012/6/6/get-ipv4-and-ipv6-addresses-of-local-host-in-a-programming-way.34055.html
获取本机ipv6地址,最简单的方法:
cat /proc/net/if_inet6
还可以使用python的netinterface
包。
ifconfig
也是从这个文件进行获取的,只是优化了一下格式。