IPv6 link-local addresses are a special scope of address which can be used only within the context of a single layer two domain. Packets sourced from or destined to a link-local address are not forwarded out of the layer two domain by routers. These addresses are useful for establishing communication across a link in the absence of a globally routable prefix or for intentionally limiting the scope of traffic which should not be routed (for example, routing protocol advertisements).
Link-local addresses are defined in section 2.5.6 of RFC 4291 as having a ten-bit prefix of 0xfe80 followed by 54 zero bits and a 64-bit interface ID:
| 10 | | bits | 54 bits | 64 bits | +----------+-------------------------+----------------------------+ |1111111010| 0 | interface ID | +----------+-------------------------+----------------------------+
Thus, link-local addresses are typically described as always starting with 0xfe80. However, section 5.3 of RFC 4862 elaborates on the process used to generate a link-local address:
The left-most 'prefix length' bits of the address are those of the link-local prefix.
The bits in the address to the right of the link-local prefix are set to all zeroes.
If the length of the interface identifier is N bits, the right-most N bits of the address are replaced by the interface identifier.
Technically speaking, any address within the prefix fe80::/10 is considered a link-local address; this includes addresses beginning with fe80:: through febf::. (This last address prefix bumps up next to the fec0::/10 range assigned to the deprecated site-local address scope.) In common practice though, link-local addresses will typically begin with 0xfe80.
On Cisco IOS, an IPv6 interface must be assigned at least a link-local address. A link-local address is automatically generated using EUI-64 when a global IPv6 address is assigned or when IPv6 is explicitly enabled on the interface:
R1(config)# interface f0/0 R1(config-if)# ipv6 address 2001:db8:0:12::1/64 R1(config-if)# interface f0/1 R1(config-if)# ipv6 enable R1(config-if)# do show ipv6 interface brief FastEthernet0/0 [up/up] FE80::C001:37FF:FE6C:0 2001:DB8:0:12::1 FastEthernet0/1 [up/up] FE80::C001:37FF:FE6C:1
Link-local addresses can alternatively be manually configured:
R1(config-if)# ipv6 address fe80::1 ? link-local Use link-local address R1(config-if)# ipv6 address fe80::1 link-local R1(config-if)# do show ipv6 interface brief FastEthernet0/0 [up/up] FE80::C001:37FF:FE6C:0 2001:DB8:0:12::1 FastEthernet0/1 [up/up] FE80::1
Notice that the
link-local argument is only applicable when assigning an address within the link-local scope:
R1(config-if)# ipv6 address fe90::1 link-local R1(config-if)# ipv6 address febf::1 link-local R1(config-if)# ipv6 address 2001:db8:0:12::1 link-local % Invalid link-local address
no form of the
ipv6 address command will replace a manually configured link-local address with an automatically configured one.
Note that, due to the nature of link-local addresses, the fe80::/10 prefix does not appear in the routing table; it is considered available via all IPv6 interfaces.
R1# show ipv6 route IPv6 Routing Table - 3 entries Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP U - Per-user Static route, M - MIPv6 I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2 ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2 D - EIGRP, EX - EIGRP external C 2001:DB8:0:12::/64 [0/0] via ::, FastEthernet0/0 L 2001:DB8:0:12::1/128 [0/0] via ::, FastEthernet0/0 L FF00::/8 [0/0] via ::, Null0
As such, it is necessary to specify from which interface packets should be sourced when you ping a link-local address:
R1# ping FE80::C002:37FF:FE6C:0 Output Interface: f0/0 % Invalid interface. Use full interface name without spaces (e.g. Serial0/1) Output Interface: fastethernet0/0 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to FE80::C002:37FF:FE6C:0, timeout is 2 seconds: Packet sent with a source address of FE80::C001:37FF:FE6C:0 !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/8 ms
Newer IOS versions also support specification of the outgoing interface using the % character, in the following form:
R1# ping FE80::C002:37FF:FE6C:0%fastethernet0/0