Get the ipv6 address from a interface

"Martin v. Löwis" martin at v.loewis.de
Fri Apr 10 00:47:39 CEST 2009


> which works great. But i am not enough into python to port that to
> ipv6. It has to work under linux only. Any help is appreciated.

Not sure how universal this is, but I would read /proc/net/if_inet6.
At least, that's what ifconfig does, and it seems to work fine.

martin at mira:~$ cat /proc/net/if_inet6
fe80000000000000000000004d804137 1c 40 20 80    sixxs
fe80000000000000020d61fffe543e15 02 40 20 80      sis
00000000000000000000000000000001 01 80 10 80       lo
200106f809000a850000000000000002 1c 40 00 80    sixxs

Regards,
Martin



More information about the Python-list mailing list