You are on page 1of 7

How to use automatic TCP/IP addressing without a DHCP

server
View products that this article applies to.
This article was previously published under Q220874

On This Page

• SUMMARY
• MORE INFORMATION
o Examples of Where APIPA May Be Useful
 Example 1: No Previous IP Address and no DHCP Server
 Example 2: Previous IP Address and no DHCP Server
 Example 3: Lease Expires and no DHCP Server

Expand all | Collapse all

SUMMARY

This article describes how to use automatic Transmission Control Protocol/Internet Protocol (TCP/IP)

addressing without a Dynamic Host Configuration Protocol (DHCP) server being present on the

network. The operating system versions listed in the "Applies to" section of this article have a

feature called Automatic Private IP Addressing (APIPA). With this feature, a Windows computer can

assign itself an Internet Protocol (IP) address in the event that a DHCP server is not available or

does not exist on the network. This feature makes configuring and supporting a small Local Area

Network (LAN) running TCP/IP less difficult.

Back to the top

MORE INFORMATION

Important This section, method, or task contains steps that tell you how to modify the registry.

However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure

that you follow these steps carefully. For added protection, back up the registry before you modify

it. Then, you can restore the registry if a problem occurs. For more information about how to back

up and restore the registry, click the following article number to view the article in the Microsoft

Knowledge Base:

322756 How to back up and restore the registry in Windows

A Windows-based computer that is configured to use DHCP can automatically assign itself an

Internet Protocol (IP) address if a DHCP server is not available. For example, this could occur on a

network without a DHCP server, or on a network if a DHCP server is temporarily down for
maintenance.

The Internet Assigned Numbers Authority (IANA) has reserved 169.254.0.0-169.254.255.255 for

Automatic Private IP Addressing. As a result, APIPA provides an address that is guaranteed not to

conflict with routable addresses.

After the network adapter has been assigned an IP address, the computer can use TCP/IP to

communicate with any other computer that is connected to the same LAN and that is also

configured for APIPA or has the IP address manually set to the 169.254.x.y (where x.y is the client’s

unique identifier) address range with a subnet mask of 255.255.0.0. Note that the computer cannot

communicate with computers on other subnets, or with computers that do not use automatic

private IP addressing. Automatic private IP addressing is enabled by default.

You may want to disable it in any of the following cases:

- Your network uses routers.

- Your network is connected to the Internet without a NAT or proxy server.

Unless you have disabled DHCP-related messages, DHCP messages provide you with notification

when you change between DHCP addressing and automatic private IP addressing. If DHCP

messaging is accidentally disabled, you can turn the DHCP messages back on by changing the value

of the PopupFlag value in the following registry key from 00 to 01:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\DHCP

Note that you must restart your computer for the change to take effect. You can also determine

whether your computer is using APIPA by using the Winipcfg tool in Windows Millennium Edition,

Windows 98, or Windows 98 Second Edition:

Click Start, click Run, type "winipcfg" (without the quotation marks), and then click OK. Click More

Info. If the IP Autoconfiguration Address box contains an IP address within the 169.254.x.x range,

Automatic Private IP Addressing is enabled. If the IP Address box exists, automatic private IP

addressing is not currently enabled.

For Windows 2000, Windows XP, or Windows Server 2003, you can determine whether your

computer is using APIPA by using the IPconfig command at a command prompt:


Click Start, click Run, type "cmd" (without the quotation marks), and then click OK to open a MS-

DOS command line window. Type "ipconfig /all" (without the quotation marks), and then hit the

ENTER key. If the 'Autoconfiguration Enabled' line says "Yes", and the 'Autoconfiguration IP Address'

is 169.254.x.y (where x.y is the client's unique identifier), then the computer is using APIPA. If the

'Autoconfiguration Enabled' line says "No", then the computer is not currently using APIPA.

You can disable automatic private IP addressing by using either of the following methods.

You can configure the TCP/IP information manually, which disables DHCP altogether. You can

disable automatic private IP addressing (but not DHCP) by editing the registry. You can do so by

adding the "IPAutoconfigurationEnabled" DWORD registry entry with a value of 0x0 to the following

registry key for Windows Millennium Edition, Windows98, or Windows 98 Second Edition:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\DHCP

For Windows 2000, Windows XP, and Windows Server 2003, APIPA can be disabled by adding the

"IPAutoconfigurationEnabled" DWORD registry entry with a value of 0x0 to the following registry

key:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\<Adapter

GUID>

Note The Adapter GUID subkey is a globally unique identifier (GUID) for the computer's LAN

adapter.

Specifying a value of 1 for IPAutoconfigurationEnabled DWORD entry will enable APIPA, which is the

default state when this value is omitted from the registry.

Back to the top

Examples of Where APIPA May Be Useful

Example 1: No Previous IP Address and no DHCP Server

When your Windows-based computer (configured for DHCP) is initializing, it broadcasts three or

more "discover" messages. If a DHCP server does not respond after several discover messages are

broadcast, the Windows computer assigns itself a Class B (APIPA) address. Then the Windows

computer will display an error message to the user of the computer (providing it has never been

assigned an IP address from a DHCP server in the past). The Windows computer will then send out

a Discover message every three minutes in an attempt to establish communications with a DHCP

server.

Example 2: Previous IP Address and no DHCP Server


The computer checks for the DHCP server and if none are found, an attempt is made to contact

the default gateway. If the default gateway replies, then the Windows computer retains the

previously-leased IP address. However, if the computer does not receive a response from the

default gateway or if none are assigned, then it uses the automatic private IP addressing feature to

assign itself an IP address. An error message is presented to the user and discover messages are

transmitted every 3 minutes. Once a DHCP server comes on line, a message is generated stating

communications have been re-established with a DHCP Server.

Example 3: Lease Expires and no DHCP Server

The Windows-based computer tries to re-establish the lease of the IP address. If the Windows

computer does not find a DCHP server, it assigns itself an IP address after generating an error

message. The computer then broadcasts four discover messages, and after every 5 minutes it

repeats the whole procedure until a DHCP server comes on line. A message is then generated

stating that communications have been re-established with the DHCP Server.

Back to the top

APPLIES TO

• Microsoft Windows Server 2003, 64-Bit Datacenter Edition

• Microsoft Windows Server 2003, Enterprise x64 Edition

• Microsoft Windows Server 2003, Datacenter Edition (32-bit x86)

• Microsoft Windows Server 2003, Enterprise Edition (32-bit x86)

• Microsoft Windows Server 2003, Web Edition

• Microsoft Windows XP Home Edition

• Microsoft Windows XP Professional

• Microsoft Windows XP Tablet PC Edition

• Microsoft Windows 2000 Server

• Microsoft Windows 2000 Advanced Server

• Microsoft Windows 2000 Professional Edition

• Microsoft Windows 2000 Datacenter Server

• Microsoft Windows Millennium Edition

• Microsoft Windows 98 Second Edition

• Microsoft Windows 98 Standard Edition


Automatic Private IP Addressing (APIPA) Overview

DHCP is a service that functions at the application layer of the TCP/IP protocol stack.
One of the primary tasks of the DHCP service is to automatically assign IP addresses to
DHCP clients. A server running the DHCP service is called a DHCP server. The DHCP
service automates the configuration of TCP/IP clients because IP addressing occurs
through the system. The DHCP server assigns IP addresses from a predetermined IP
address range(s), called a scope. To summarize, the DHCP server dynamically assigns IP
addresses to DHCP clients, and also allocates TCP/IP configuration information to DHCP
clients, such as DNS server IP address and WINS server IP address.

To uniquely identify computers on a


TCP/IP based network, each computer must have a unique IP address. To communicate
on the Internet and private TCP/IP network, all hosts defined on the network must have
IP addresses. When the DHCP client boots up on the network, a negotiation process
called the DHCP lease process occurs between the DHCP server and client. During the
DHCP lease process, IP address and any additional TCP/IP configuration parameters are
provided to DHCP clients by the DHCP server. Prior to the Automatic Private IP
Addressing (APIPA) feature, a DHCP client received no notification if the DHCP lease
process was unsuccessful in allocating an IP address to a DHCP client. The client was
also not able to configure its own IP address if it could not obtain an IP address because
the DHCP server was unavailable.

With the introduction of Automatic Private IP Addressing (APIPA) feature, a DHCP


client that cannot obtain an IP address from a DHCP server is able to configure its own
IP address.

How APIPA works

1. A client is configured to automatically obtain an IP address from the DHCP


server.
2. The client is however unable to contact the DHCP server for dynamic IP address
assignment because the DHCP server is unavailable.
3. The client computer uses the APIPA feature to assign and configure its own
private IP address.
4. The IP address which the client assigns to itself is a private IP address in the
address range of 169.254.0.0 to 169.254.255.255. This address range is reserved
by Internet Assigned Numbers Authority (IANA).
5. The client continues to check whether the DHCP server is available at 5 minute
intervals.
6. When the DHCP is available again, the client that assigned itself an IP address
through APIPA initiates the DHCP lease process to request and obtain an IP
address from the DHCP server.
7. When the DHCP server assigns an IP address to the client, the client replaces the
APIPA address with the one it obtained from the DHCP server.
APIPA addresses are invalid on the Internet, and computers that are using APIPA
addresses can only communicate with other computers using APIPA addresses on the
same network segment.

The APIPA feature configures the client with the following:

• IP address
• Subnet mask

The APIPA feature cannot configure the client with any other TCP/IP configuration:

• Default gateway
• DNS server IP address
• WINS server IP address

You have to use an alternate configuration to provide the above TCP/IP configuration
information to a client when no DHCP server is available for the client.

APIPA is supported in the following Microsoft Windows operating systems:

• Windows 98
• Windows Millennium Edition (Me)
• Windows 2000
• Windows XP
• Windows Server 2003

How to check whether APIPA is enabled

1. At a command prompt, enter ipconfig /all to view IP address information.


2. Verify that Autoconfiguration Enabled is displayed with Yes.
3. Verify that the IP address is within the address range of 169.254.0.0 to
169.254.255.255.

How to disable APIPA

You can disable the APIPA feature for only one adapter, or you can disable APIPA for
all adapters. The APIPA feature is disabled by editing certain Registry keys in the
Windows Registry.

How to disable APIPA on one adapter

1. Open the Registry Editor.


2. In the
HKLM\System\CurrentControlSet\Services\Tcpip\Parameters\InterfaceAdapterK
ey subkey, add the IPAutoconfigurationEnabled entry with a value of 0.
3. Restart the computer.
How to disable APIPA for all adapters

1. Open the Registry Editor.


2. In the
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Param
eters subkey, set the IPAutoconfigurationEnabled entry with a value of 0.
3. Restart the computer.

You might also like