We know that we can use the MAC address to create an interface identifier, e.g. for a link-local IPv6 address which should be unique in the Network.The image shows the way to do this:My questions are:How can I create an IPv6 address from a MAC using awk or sed?OR is there any command that gives me the link-local IPv6 address for a specific MAC (something like that createIPv6 myMAC)?
How to use shell to derive an IPv6 address from a MAC address?
sed;awk;ipv6;mac address
If you want to create a whole IPv6 address from a MAC (and a given prefix), you could use the excellent ipv6calc tool by Peter Bieringer.The following command creates a link-local IPv6 address (fe80:: prefix) from a MAC address:$ ipv6calc --action prefixmac2ipv6 --in prefix+mac --out ipv6addr fe80:: 00:21:5b:f7:25:1bfe80::221:5bff:fef7:251bYou can leave most of the options away and let the command guess what to do:$ ipv6calc --in prefix+mac fe80:: 00:21:5b:f7:25:1bNo action type specified, try autodetection...found type: prefixmac2ipv6fe80::221:5bff:fef7:251bFor Debian distros, ipv6calc is in the main repository.