Sub topic 9
When No Server Answers: The 169.254.0.0/16 Fallback
This chapter assumes you know IPv4 addresses and subnet masks, what a default gateway and a DNS server do, and the basic Discover, Offer, Request, Acknowledge (DORA) exchange. You also need to know what a lease is. Here you will see what a client does when DORA never completes, and how to read the result.
What the fallback is
When a client cannot get a lease, many operating systems pick an address for themselves from the range 169.254.0.0/16. This is the IPv4 link-local range. RFC 3927 defines it as "Dynamic Configuration of IPv4 Link-Local Addresses". Microsoft calls its implementation Automatic Private IP Addressing (APIPA). Linux desktops, macOS and many embedded devices do the same thing, though the details vary by distribution and network manager.
A link-local address is valid only on the local link, which is the one LAN segment the client is attached to. Routers must not forward packets whose source or destination is in 169.254.0.0/16. The address works for talking to neighbors on the same switch or VLAN. It does not work for reaching the internet or any other subnet.
The usable range is 169.254.1.0 to 169.254.254.255. The first and last 256 addresses are reserved by the RFC for future use, so a client does not choose from them. The subnet mask is always 255.255.0.0.
| Property | Value |
|---|---|
| Range | 169.254.0.0/16 (clients use 169.254.1.0 to 169.254.254.255) |
| Subnet mask | 255.255.0.0 |
| Default gateway | None |
| DNS server | None |
| Routable | No, routers must not forward it |
| Defined by | RFC 3927 |
Why it exists
Without a fallback, a client that gets no answer would have no IPv4 address at all. Two laptops connected by one cable, or two devices on a small switch with no DHCP server, could not talk to each other. The fallback lets devices on the same link reach each other without any server or manual setup. Printers, cameras and file-sharing tools often depend on this for direct connections.
The same feature causes confusion in managed networks. A user whose DHCP server is down gets an address that looks valid but cannot reach anything beyond the local link. The 169.254.x.x address is a symptom, not a configuration someone chose.
How the client picks an address
The client does not ask anyone for a link-local address. It chooses one and then checks that nobody else is using it. The steps are:
- The client tries DHCP first. It sends Discover messages and waits, retrying with increasing delays.
- If no Offer arrives within the client's timeout, it gives up on DHCP for now.
- It picks a candidate address in
169.254.1.0to169.254.254.255. RFC 3927 recommends seeding the pseudo-random choice from the interface's MAC address, so the same device tends to pick the same address again. - It runs address conflict detection using ARP probes. It sends several ARP probe packets asking "who has this address?" with a sender address of
0.0.0.0. The0.0.0.0sender keeps the probe from polluting other hosts' ARP caches. - If another host answers, or sends its own probe for the same address, there is a conflict. The client picks a different address and probes again.
- If nothing objects, the client sends ARP announcements and starts using the address.
RFC 3927 specifies three probes spaced 1 to 2 seconds apart, followed by two announcements. A client therefore needs several seconds before the address is usable. A conflict that appears later, for example when two isolated segments are joined, is handled by defending the address or choosing a new one.
The client keeps looking for DHCP
Using a link-local address does not end the DHCP attempt. The client keeps sending Discover messages in the background. RFC 3927 leaves the interval to the implementation, and Windows retries about every 5 minutes. When a server finally answers, the client completes DORA and switches to the leased address. Existing connections that were using the 169.254.x.x address break at that point.
This is why a machine can recover without user action after a DHCP server comes back. It can also take minutes to do so. Running ipconfig /renew on Windows, or restarting the client, forces an immediate attempt.
What it looks like on a host
On Windows, ipconfig /all shows the fallback clearly:
ipconfig /allIn the output for the affected adapter, look for lines like these:
Autoconfiguration IPv4 Address . . : 169.254.37.112(Preferred)Subnet Mask . . . . . . . . . . . : 255.255.0.0Default Gateway . . . . . . . . . :(empty)DHCP Enabled . . . . . . . . . . : Yes
The key detail is "Autoconfiguration IPv4 Address" instead of "IPv4 Address", together with DHCP Enabled: Yes. DHCP is turned on, but it did not succeed.
On Linux, check the interface and then force another attempt:
ip -4 addr show eth0
sudo dhclient -r eth0
sudo dhclient -v eth0
ip -4 addr show eth0In ip -4 addr output, a link-local address typically shows scope link, as in inet 169.254.37.112/16 ... scope link. Many Linux distributions do not assign a link-local address by default when DHCP fails. Whether you see one depends on your network manager. NetworkManager, for example, can be set to link-local for IPv4 and defaults to failing the connection otherwise. If a Linux host shows no IPv4 address at all, that is the same failure shown differently.
Watching it in a capture
You can see the sequence on the wire. Capture DHCP and ARP together:
sudo tcpdump -n -i eth0 -vv 'udp and (port 67 or port 68) or arp'Bring the interface up on a segment with no DHCP server. You will see:
- Repeated Discover messages from
0.0.0.0port 68 to255.255.255.255port 67, with no Offer in reply. - ARP probes for a
169.254.x.xaddress, with sender0.0.0.0. - ARP announcements for the same address.
- Later, more Discover messages at a slower rate while the client sits on its link-local address.
Absence of Offers in this capture tells you the problem is upstream of the client: no server, a blocked path, or a relay that is not forwarding.
Common causes
A 169.254.x.x address means the client sent Discover and got no usable Offer. The cause is somewhere between the client and the server. Common causes:
- The DHCP server is down or unreachable. The service stopped, the host crashed, or its network link failed.
- The scope is exhausted. The server has no free addresses and stays silent. Some servers send nothing at all in this case, so the client sees no response.
- The client is on the wrong VLAN. The switch port is in a VLAN where no server or relay exists.
- A relay agent is missing or misconfigured. The server is on a different subnet and nothing forwards the broadcast. The next chapters on relay agents cover this.
- DHCP snooping or a firewall blocks the traffic. A switch may drop server replies arriving on an untrusted port.
- A Wi-Fi association or authentication issue. The link looks up but traffic does not flow, for example with a bad port-security or 802.1X state.
- A cable or port fault. Link flaps can cause DHCP to time out while the link is still negotiating.
Working through a diagnosis
Suppose a user reports that the network is "connected but nothing works", and ipconfig /all shows 169.254.37.112. A practical order of checks:
- Check the physical and link layers. Confirm the link light, the correct port and the correct Wi-Fi network. Check the VLAN assignment on the switch port.
- Try another client on the same port or VLAN. If it also gets a
169.254address, the fault is in the network path or server, not the first client. - Capture on the client. If Discover leaves but no Offer returns, move the capture toward the server, for example on the server's interface or the relay.
- Check the server. Confirm the service is running, the scope is active and addresses are free. Look at the server's logs for received Discover messages.
- Check the relay. Confirm the router interface facing the client has the correct helper or relay address for the server.
- Check switch security. Confirm the uplink toward the server is a trusted port if DHCP snooping is on.
If the server logs show a Discover and an Offer, but the client never sees it, the reply is being lost on the way back. If the server logs show nothing, the Discover never arrived.
Edge cases and pitfalls
- Two link-local hosts can talk, and that can hide the problem. A user may reach a neighbor's shared folder and conclude the network works, while internet access fails.
- A link-local address plus a manual gateway is not a fix. Adding a gateway to a
169.254interface does not make the address routable. Routers drop such traffic, and the correct fix is to get a real lease. - Multiple interfaces can confuse routing. A laptop with Wi-Fi on a real lease and Ethernet on
169.254.x.xmay try to route through the wrong adapter, depending on interface metrics. - It can be disabled. On Windows, the registry value
IPAutoconfigurationEnabledset to0turns the fallback off. The adapter then shows0.0.0.0instead, which some administrators prefer because it fails visibly. Disabling it breaks the zero-configuration case described above. - Alternate configuration on Windows. The adapter can be given an alternate static address that it uses instead of a
169.254address when DHCP fails. This suits laptops that move between a DHCP network and a fixed lab network. - Don't mistake it for a lease. A link-local address has no lease time, no T1 or T2, and no server. The timers from the previous chapter do not apply to it.
- Monitoring. Many networks alert on any
169.254.x.xsource address seen in switch ARP tables or flow data. It is a cheap indicator of a client that lost DHCP.
Exercise
A Windows laptop shows "Autoconfiguration IPv4 Address: 169.254.37.112", mask 255.255.0.0, no default gateway, and "DHCP Enabled: Yes". A tcpdump on the laptop shows repeated Discover messages and no Offers. Name two possible causes on the network side, and explain why the laptop can still reach a printer on the same switch that also has a 169.254 address but cannot reach a web server.
Show answer
Possible causes include the DHCP server being down or its scope being full, the port being in a VLAN with no server or relay, a relay agent with a wrong helper address, or DHCP snooping dropping the server's replies. The laptop reaches the printer because both are on the same link and in the same 169.254.0.0/16 network, so they exchange frames directly after ARP. It cannot reach the web server because the address has no default gateway, and routers must not forward link-local traffic, so packets to other networks have no path.
Exercise
Why does a client send ARP probes with sender address 0.0.0.0 before using a 169.254.x.x address, and what does it do if another host replies?
Show answer
The probe asks whether anyone already uses the candidate address. The sender address 0.0.0.0 avoids teaching other hosts a mapping for an address the client does not yet own. If another host replies, or probes for the same address, there is a conflict, so the client picks a different random address in 169.254.1.0 to 169.254.254.255 and probes again.