[139407] in North American Network Operators' Group
Re: link-local address calculation
daemon@ATHENA.MIT.EDU (Owen DeLong)
Thu Apr 7 08:54:17 2011
From: Owen DeLong <owen@delong.com>
In-Reply-To: <BANLkTinmwCK8JMHRKaB-VOdn3FAG0YCtog@mail.gmail.com>
Date: Thu, 7 Apr 2011 05:48:50 -0700
To: Vikas Sharma <vikassharmas@gmail.com>
Cc: nanog@nanog.org
Errors-To: nanog-bounces+nanog.discuss=bloom-picayune.mit.edu@nanog.org
On Apr 7, 2011, at 1:18 AM, Vikas Sharma wrote:
> Hi,
>=20
> How to get link-local address from BIA. I have seen some information
> on Internet but it is not working for all.
>=20
Pretty simple:
Split the BIA into two 24 bit chunks:
cc000b / fc0000
Then insert fffe in the middle:
cc000b fffe fc0000
Now invert the 0x02 bit of the first octet:
ce000b fffe fc0000
Prefix with fe80::
fe80::ce00:0bff:fefc:0000
Which if you shorten it becomes:
fe80::ce00:bff:fefc:0
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> The BIA in this case is cc00.0bfc.0000. The rules for the modified
> EUI-64 addressing are:
>=20
> =95FFFE will be put in between the vendor-id (3 most significant =
bytes)
> and the extension-id (3 least significant bytes), which will lead to
> cc00.0bFF.FEfc.0000
> =95Thereafter the seventh bit, known as universal/local bit, gets
> inverted. So first change the cc00 from hex to binary, which leads to
> 110011 0 000000000 and then invert the seventh bit (here a 0): 110011
> 1 000000000. Moved back to hex this will give CE00
> =95At last, change all points =91.=92 to colons =91:=92 and delete all =
leading
> zeros, then you got your link-local IPv6 address:
> FE80::CE00:BFF:FEFC:0
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>=20
> So if your BIA is 0008.209a.081b (bia 0008.209a.081b), how link-local
> be calculated. This is the link-local on router =3D>
> IPv6 is enabled, link-local address is FE80::208:20FF:FE9A:81B
>=20
> Also on XR below is the link local address
>=20
> Loopback6 is Up, ipv6 protocol is Up, Vrfid is default (0x60000000)
> IPv6 is enabled, link-local address is fe80::884c:2dff:fe84:8d75
>=20
> I can not see any interface with BIA ending with 75 ...
>=20
Have you looked for the BIA on the loopback interface? While it's not
a hardware interface, per se, the device is obviously assigning
a BIA of 8a:4c:2d:84:8d:75 to the loopback6 interface.
> Can someone explain me this?
>=20
I think I just did. ;-)
Owen