#readwise
# Link-Local Address - Wikipedia

## Metadata
- Author: [[wikipedia.org]]
- Full Title: Link-Local Address
- URL: https://en.wikipedia.org/wiki/Link-local_address
## Highlights
In [computer networking](https://en.wikipedia.org/wiki/Computer_network), a link-local address is a network address that is valid only for communications on a [[Link Layer - Wikipedia|local link]], i.e. within a [subnetwork](https://en.wikipedia.org/wiki/Subnetwork) that a host is connected to. Link-local addresses are most often [unicast network addresses](https://en.wikipedia.org/wiki/Unicast_network_address) assigned automatically through a process known as stateless address autoconfiguration (SLAAC) or link-local address autoconfiguration, also known as automatic private IP addressing (APIPA) or auto-IP. ([View Highlight](https://read.readwise.io/read/01hy2z2vm4m63q8ptyqv0839bf))
---
Link-local addresses are not guaranteed to be unique beyond their network segment. Therefore, [routers](https://en.wikipedia.org/wiki/Router_(computing)) do not forward [packets](https://en.wikipedia.org/wiki/Data_packet) with link-local source or destination addresses. ([View Highlight](https://read.readwise.io/read/01hy2z3603jr9sjrw81fb0wjsa))
---
[[IPv4 - Wikipedia|IPv4]] link-local unicast addresses are assigned from address block 169.254.0.0/16 (169.254.0.0 through 169.254.255.255). In [[IPv6 - Wikipedia|IPv6]], unicast link-local addresses are assigned from the block fe80::/10. ([View Highlight](https://read.readwise.io/read/01hy2z3hgmgzjssk031n4vbkwz))
---
Link-local addresses may be assigned manually by an administrator or by automatic operating system procedures. In [[Internet Protocol - Wikipedia|Internet Protocol]] (IP) networks, they are assigned most often using stateless address autoconfiguration, a process that often uses a [stochastic](https://en.wikipedia.org/wiki/Stochastic) process to select the value of link-local addresses, assigning a pseudo-random address that is different for each session. However, in IPv6 the link-local address may be derived from the interface [media access control](https://en.wikipedia.org/wiki/Media_access_control) (MAC) address in a rule-based method, although this is deprecated for privacy and security reasons. ^phb1jc
In IPv4, link-local addresses are normally only used when no external, stateful mechanism of address configuration exists, such as the [[Dynamic Host Configuration Protocol - Wikipedia|Dynamic Host Configuration Protocol]] (DHCP), or when another primary configuration method has failed. In IPv6, link-local addresses are always assigned, along with addresses of other scopes, and are required for the internal functioning of various protocol components. ([View Highlight](https://read.readwise.io/read/01hy2z54ymhqed4gj2dq82m244)) ^olsw69
---
### IPv4
The simultaneous use of IPv4 addresses of different scope on the same interface, such as configuring link-local addresses as well as globally routable addresses, may lead to confusion and increased complexity. Therefore, hosts search for a DHCP server on the network before assigning link-local addresses. ([View Highlight](https://read.readwise.io/read/01hy2z8t8pq6xctrkprqcabmrd)) ^veckbb
---
In the automatic address configuration process, network hosts select a random candidate address within the reserved range and use [[Address Resolution Protocol - Wikipedia|Address Resolution Protocol]] (ARP) probes to ascertain that the address is not in use on the network. If a reply is received to the ARP probe, it indicates the candidate IP address is already in use; a new random candidate IP address is then created and the process repeated. The process ends when there is no reply to the ARP, indicating the candidate IP address is available. ([View Highlight](https://read.readwise.io/read/01hy2z8x5rd0nrnq9w6m29jw4j)) ^l6luwb
---
### IPv6
Unlike IPv4, IPv6 requires a link-local address on every network interface on which the IPv6 protocol is enabled, even when routable addresses are also assigned. Consequently, IPv6 hosts usually have more than one [IPv6 address](https://en.wikipedia.org/wiki/IPv6_address) assigned to each of their IPv6-enabled network interfaces. The link-local address is required for IPv6 sublayer operations of the [[Neighbor Discovery Protocol - Wikipedia|Neighbor Discovery Protocol]], as well as for some other IPv6-based protocols, such as [[DHCPv6 - Wikipedia|DHCPv6]]. ^c42dzx
When using an IPv6 link-local address to connect to a host, a [zone index](https://en.wikipedia.org/wiki/IPv6_address#zone_index) must be added to the address so that the packets can be sent out on the correct interface.
In IPv6, addresses may be assigned by [stateless](https://en.wikipedia.org/wiki/Stateless_protocol) (without memory) or stateful (with memory) mechanisms. [Stateless address autoconfiguration](https://en.wikipedia.org/wiki/IPv6_stateless_address_autoconfiguration) is performed as a component of the Neighbor Discovery Protocol (NDP). The address is formed from its routing prefix and a unique identifier for the network interface.
Through NDP routing prefix advertisements, a router or server host may announce configuration information to all link-attached interfaces which causes additional IP address assignment on the receiving interfaces for local or global routing purposes. This process is sometimes also considered stateless, as the prefix server does not receive or log any individual assignments to hosts. Uniqueness is guaranteed automatically by the address selection methodology. It may be MAC-address based, or randomized. Automatic duplicate address detection algorithms prevent assignment errors. ([View Highlight](https://read.readwise.io/read/01hy2zb4t8031j23rkb5fgcpxx))
---