Do you know how I could get one of the IPv6 adress of one of my interface in python2.6. I tried something with the socket module which lead me nowhere.
Thanks.
Generic unix instructions for determining your IPv6 address and default route: Run ifconfig -a and look for inet6 to see your possible IPv6 addresses. Run netstat -nr and look for inet6 or Internet6 or similar to find the IPv6 portion; then look for default or :: or ::/0 .
The second part of an IPv6 unicast or anycast address is typically a 64-bit interface identifier used to identify a host's network interface. A 64-bit interface ID is created by inserting the hex value of FFFE in the middle of the MAC address of the network card.
To check whether a CS Linux server is running IPv4 or IPv6, use the command ifconfig -a and look at the IP address or addresses in the output. These will be IPv4 dotted-decimal addresses, IPv6 hexadecimal addresses, or both.
What You Will Need. Before you can request IPv6 addresses, you need to become a RIPE NCC member and open your Local Internet Registry (LIR) account. As part of this process, you will create a secure RIPE NCC Access account that allows you to request IP addresses and AS Numbers and maintain your LIR's information.
The netifaces module should do it.
import netifaces
addrs = netifaces.ifaddresses('eth0')
addrs[netifaces.AF_INET6][0]['addr']
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With