Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


October 25, 1999

Automatic Private IP Addressing


RSS
Subscribe to Windows IT Pro | See More Domain Name System (DNS) Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

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.

End of Article



Reader Comments
Excellent. Just what I wanted to know.

dave November 03, 2003


I appreciate your article but please put more light on the distinction between DNS and DHCP

Andrew valentine November 14, 2003


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.

Roman November 23, 2003


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).

donald v December 03, 2003


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.


Chandrashekar December 09, 2003


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************

R.santhosh April 20, 2004


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.

Thomas May 09, 2004


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?

Doug June 03, 2004


My ip defaults to 169.254.0.0 and will not pick up my router dhcp. What can i do so it doesn't default to 169.254.0.0 and finds my router. TCP is is set to auto obtain addressing.

Tom July 02, 2004


APIPA was explained crisply. Great work Zubair!!!.
*****
Prasanna
-Technical Support. Hewlett Packard

Prasanna July 07, 2004


 See More Comments  1   2 

You must be a registered user or online subscriber to comment on this article. Please log on before posting a comment. Are you a new visitor? Register now




Top Viewed ArticlesView all articles
Battery Life Issues Almost Certainly Not Windows 7's Fault

While Microsoft is still investigating a notebook battery life issue that was supposedly caused by Windows 7, some interesting trends have emerged. ...

Confirmed: Battery Life Issues Not Windows 7's Fault

Microsoft on Monday issued a lengthy statement about the recent Windows 7 battery controversy, echoing my assessment from earlier in the day, but backing it up with hard, cold evidence. Put simply, Windows 7 is not responsible for any battery life issues ...

Getting your iPhone to Sync with Exchange 2003

Follow these steps to use an iPhone with Exchange. ...


Windows OSs Whitepapers Protecting Microsoft SharePoint

Related Events Deep Dive into Windows Server 2008 R2 presented by John Savill

Managing IT Across Multiple Locations

Windows, Unix, Linux Interoperability

Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs Resources Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2010 Penton Media, Inc. Terms of Use | Privacy Statement