SLAAC Discovery and EUI-64 Converting (MAC Address based IPv6 Address assigning!)
Recently Crucial has been gearing up for IPv6 inclusion in our services, it’s been my task to deliver this in the best way possible.
Some of the features that IPv6 provide which weren’t included in IPv4 are:
- More efficient address space allocation
- End-to-end addressing; no NAT anymore!
- Fragmentation only by the source host
- Routers do not calculate header checksum (speedup!)
- Multicasting instead of broadcasting
- Built-in security mechanisms
- Single control protocol (ICMPv6)
- Modular headers structure
But most importantly AUTO CONFIGURATION!
IPv6 allows for auto-configuration using the EUI-64 specification and SLAAC discovery.
SLAAC is a stateless configuration, though it generates network traffic it doesn’t need a server or client configuration nor does it communicate with a centralized administrator.
So today I will be teaching you how to take your MAC address and any /64 block of IPv6 and return a unique IPv6 address from it!
This little howto relies heavily off HEX and binary, if your not confident with either, I suggest using the following little reference as a guide:
Conversion Code – Chart | ||||||||||||||||
DECIMAL | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
HEX | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
BINARY | 0000 | 0001 | 0010 | 0011 | 0100 | 0101 | 0110 | 0111 | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 |
If you still have trouble understanding this, I guess the alternative option is to use wikipedia and get comfy with binary and HEX.
With the above conversion chart at your side and a coffee in your hand, lets start!
So lets take your MAC address, this can be obtained using the following:]
Windows:
Start Menu -> Run -> Type: cmd & press enter.
type “ipconfig /all” in the command prompt:
C:\Users\Karl>ipconfig /all
You should get some mumble jumble but what you’re specifically looking for is:
Ethernet adapter Local Area Connection:
Physical Address. . . . . . . . . : 00-1C-C0-E2-84-E4
The Physical Address is your 48 Bit MAC Address (note down that this is in 48 bits, it’s very important to know this for later!)
Like wise to do this on an OSX:
Open a terminal screen and type:
- “ifconfig en0” (<– That’s a zero) for ethernet
- “ifconfig en1” for wireless apple airport.
Access terminal by holding down APPLE(COMMAND) + SHIFT + U, this will give you access to the utilities folder and in there you will find terminal.
inside the terminal you can do:
karl-mbp2:~ karl: ifconfig en1
What you are looking for is the “ether”
ether f8:1e:df:e0:9c:2e
This is the 48 bit MAC again!
So now that you have this; the first thing we should do is convert it to EUI-64 bit so that we may use it to get our IP.
To do this we must insert 0xFFFE or simply known as FF:FE.
So today I will work with my windows IP: 00-1C-C0-E2-84-E4…
For sake of readability and standards, we will from here on write that MAC as 00:1C:C0:E2:84:E4
So we split the address into two chunks down the middle so it becomes
- Chunk one: 00:1C:C0
- Chunk two: E2:84:E4
Now between them we insert FF:FE, you might ask one why FF:FE? well that’s outside the scope of this article but have a look here: http://www.tcpipguide.com/free/t_IPv6InterfaceIdentifiersandPhysicalAddressMapping-2.htm
So you have not converted it from 48 Bits to 64 Bits as the address now becomes
64Bits = 00:1C:C0:FF:FE:E2:84:E4
So now the remaining part is to check the local link flag which is bit seven of the sixty four bit MAC.
To do this and to make it easer we should convert the 64 bit MAC into binary, use the chart above to help with your conversion.
So 00:1C:C0:FF:FE:E2:84:E4 should become:
0000 0000 : 0001 1100 : 1100 0000: 1111 1111 : 1111 1110 : 1110 0010 : 1000 0100 : 1110 0100
To make sense of that you need to remember that each character of the MAC represents four bits, that is to say:
- 0 = 0000
- 0 = 0000
- 1 = 0001
- C = 1100
So on so fourth.
So the seventh bit in my MAC needs to be inverted, so the binary becomes:
0000 0010 : 0001 1100 : 1100 0000: 1111 1111 : 1111 1110 : 1110 0010 : 1000 0100 : 1110 0100
Effectively this makes my MAC now the EUI-64 and it has become:
EUI-64 = 02:1C:C0:FF:FE:E2:84:E4
Now that we have this, we can put this into our /64 🙂
For this example I am using the link local /64 subnet… so when you do the conversion on your system it will appear the same:
My new IPv6 unique address:
IPv6 = fe80::021c:c0ff:fee2:84e4/64
And that’s it, you can use slaac for this, but this is great if your programming!
Have fun and enjoy IPv6!
Cheers,
Karl.
Hosting Options & Info | VPS | Web Solutions & Services |
---|---|---|
Pingback: Crucial Paradigm Web Solutions()
Pingback: NAV Telecom - IPv6 Subnet()