Automatic Private IP Addressing - 25 Oct 1999

Microsoft has included several features in Windows 2000 (Win2K) that are useful in small office/home office (SOHO) environments. One feature has gone through several name changes over the years, including AutoNet, Auto-IP Configuration, IP-Auto Configuration, and Automatic Private IP Addressing. In Win2K Release Candidate 2 (RC2), Microsoft has settled on Automatic Private IP Addressing (APIPA).

With APIPA, DHCP clients can automatically self-configure an IP address and subnet mask when a DHCP server isn't available. You don't need to do anything special on the clients to enable this feature. Just make sure that you configure your Win2K clients to obtain IP information from a DHCP server, as Screen 1 shows. You do this by selecting "Obtain an IP address automatically" on the General tab of the TCP/IP properties dialog box for your network adapter. By default, all Win2K clients are configured for DHCP. APIPA also works on Windows 98 clients by default.

How APIPA Works When a DHCP client boots up, it looks for a DHCP server to obtain an IP address, subnet mask, and other possible DHCP options configured on the server. If the client is unable to obtain a lease from a DHCP server, the client uses APIPA and automatically configures itself with an IP address from the Microsoft-reserved IP address range of 169.254.0.1 through 169.254.255.254. The Internet Assigned Numbers Authority (IANA) has reserved this range for private IP addressing, so no one can use it on the Internet. The client also configures itself with a default class B subnet mask of 255.255.0.0. A client uses the self-configured IP address until a DHCP server becomes available. Obviously, APIPA is meant for nonrouted small business environments.

Resolving IP Conflicts How does the client know the IP address it's using isn't in use by another machine? It uses a gratuitous Address Resolution Protocol (ARP) to resolve potential conflicts. Let’s say the first client that boots up wants to assign itself an IP address of 169.254.10.20. It sends out a gratuitous ARP, but no one answers, so it keeps the address. When a second client boots up, it randomly picks the address 169.254.1.57. To avoid duplication on the network, it, too, sends a gratuitous ARP to ensure that no other clients have selected the address. Next, a third client boots up and picks 169.254.10.20, the same address the first client chose. The first client tells the third client that it's already using that IP address, so the third client tries a different IP address and keeps it if there's no conflict. For each address conflict, the clients try self-configuration up to 10 times.

According to Microsoft documentation, the client checks for a DHCP server in the background every 5 minutes. As soon as it locates a DHCP server, the client updates its IP information from the DHCP server. The client also obtains other DHCP options configured on the DHCP server, such as default gateway, domain name, DNS server, and WINS server.

Renewing Leases In situations where the DHCP client has a previous lease from a DHCP server, the client tries to renew the lease from the DHCP server at boot time. If the lease hasn’t expired, the DHCP server renews it. By default, a Win2K server leases IP information to a DHCP client for 8 days. If the lease hasn’t expired, but for some reason the client can’t contact the DHCP server, the client takes the following steps. First, the client tries to ping the default gateway, which is the default gateway that the DHCP server assigned to it in the lease. If the ping succeeds, the client assumes that it's still located on the same network where it had previously obtained the lease, and continues to use the lease as normal. By default, Win2K clients try to renew their leases when 50 percent of the lease has expired. Note that although the renewal attempt in a Win2K network occurs at the same interval as in Windows NT, the default lease periods are 8 days in Win2K, as opposed to 3 days in NT.

If the ping to the default gateway fails, the client figures it isn't located on the same network as before, so it uses APIPA to autoconfigure itself. Laptop users typically experience this scenario when they take their machines home. In absence of a DHCP server at home, the DHCP client uses APIPA. However, the client continues to look for a DHCP server in the background every 5 minutes, so when a laptop user moves the computer to another network where a DHCP server is available, the client obtains a lease from that DHCP server.

Disabling APIPA In rare situations, you might want to disable APIPA, which you do by modifying client Registry. Run regedt32.exe and go to HKEY_LOCAL_MACHINE\SYSTEM\ CurrentControlSet\Services\Tcpip\ Parameters\Interfaces. Select the adapter for which you want to disable APIPA. Add the value IPAutoconfigurationEnabled of data type REG_DWORD and set it to 0 to disable it, as Screen 2 shows. This entry isn't present by default because the OS enables APIPA and assumes a value of 1. You need to add this value only if you want to disable APIPA. If you have multiple adapters and you want to disable APIPA for all of them, simply add the entry IPAutoconfigurationEnabled at the HKEY_LOCAL_MACHINE \SYSTEM\CurrentControlSet\Services\ Tcpip\Parameters level and set it to 0.

Discuss this Article 33

Anonymous User (not verified)

on Dec 6, 2004

"had a problem with 169.254.0.0 range where my adsl sp was unable to recognize these or even help with configuring APIPA into normal functioning public network ip adresses. They stated that they were entirely unable to do anything because my system was blocked as well as thiers from ip configurations. It has taken two different adsl sp over eight months with this problem. Was unable to connect to the internet whatsoever. At the same time there were in fact packets leaving my computer to unknown destinations when the lines were hooked up. Do you have any reasonable or rational explanation for what may have happened. This answer would enlighten some sense to this mystery. Appreciate any response. " I have that problem at the moment. The packets are being sent but after about 400 the packets stop and on both of the coms it hasn't received them? Why is it doing this and please can someone help! One last question is it still posible to share internet connection if on APIPA. Poz

Since there are a lot of people coming to our institution for some or the other programs, there was always a problem while assigning an IP dynamically. Now after going through this article, I can proudly say that there are no such problems now.
Thanks.

Just out of curiosity, why would assigning an IP address like 169.254.*.* be of any use? Why not just have no IP address at all? In other words, why does APIPA exist and what was the impetus to implement it?

Useful article on APIPA. Can I assume from your article that when using a router I should disable
APIPA. That would solve my problem of loosing
network connectivity occasionally and ending up with an IP adr of 169.254.0.0/255.255.0.0, and thus being unable to connect to my router.

I had a problem with 169.254.0.0 range where my adsl sp was unable to recognize these or even help with configuring APIPA into normal functioning public network ip adresses. They stated that they were entirely unable to do anything because my system was blocked as well as thiers from ip configurations. It has taken two different adsl sp over eight months with this problem. Was unable to connect to the internet whatsoever. At the same time there were in fact packets leaving my computer to unknown destinations when the lines were hooked up. Do you have any reasonable or rational explanation for what may have happened. This answer would enlighten some sense to this mystery. Appreciate any response.

The difference between DNS and DHCP is that DNS resolves a name into an IP address, whereas DHCP is a server-run service that gives IP configuration information to a client. This information usually includes an IP and subnet mask.

This answered my questions exactly. The Microsoft books are very poor in their explanations, often leaving important points uncovered or ambiguous to the point of being useless. This article covered the subtleties nicely (at least as far as the basic overview is concerned).

iam working as a network engineer,iam not having a clear clarity on the private ip addressing,after reading the article iam having confidence on my profesnalism,to go head with my carrer.******pls mail some networking tips to my mail ID************