Normally doing this requires you to have
all IP addresses on the interface as static (ie you cannot have
DHCP + a static IP on the one interface).
However it is actually possible to configure one interface to have
a DHCP assigned IP address plus a static IP address on the same
interface. All it requires is some very simple registry
editing.
An example of why you might want to do this is where you have your
PC configured on your company LAN via DHCP. You have a device that
comes preconfigured on some default IP addess like 192.168.0.100
and this does not match the subnet that you have been assigned via
DHCP. In that case, even if you plug this into the same physical
network, you will not be able to access it. However if you add an
IP onto your interface that is in the same subnet (eg
192.168.0.200) then you will be able to directly access the device,
without losing access to the other resources available on your
companies subnet.
Normal approach for having multiple IP addresses on the one
interface. (cannot use DHCP, only multiple static addresses)
- Open Control Panel, Network Connections.
- Right-click the connection (the default is usually called
“Local Area Connection”), then select properties.
- Select “Internet Protocol (TCP/IP)” and click properties.
- Make sure you select “Use the following IP Address” and enter
the details for the primary address.
- Click “Advanced” then click the “IP Settings”. This is where
you can add additional IP addresses.
- After configuring the additional addresses you can confirm the
configuration through the normal “ipconfig” command
(Start->Run->cmd. Then type ipconfig, enter).
How to have DHCP for first address then a static IP for
additional addresses
- Follow the steps above however at step 4, select “Obtain an IP
address automatically”. You will note now that if you click on the
“Advanced” button that you can not add additional IP addresses as
before. Instead it says “DHCP configured.
- Open the registry editor (Start->Run->Regedt32)
- Navigate to:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{27C3A9EB-F837-4DE1-ADAC-854AE98CE288}]
Note that the GUID for your own connection will not be the same as
above. There may be a number of these under the Interfaces branch.
Find the one that represents the network connection you want to
modify.
- Double click the “IPAddress” key.
- In the dialog box enter your additional IP addresses, making
sure each is on a separate line. Make sure you leave the first line
the same as it was. Click Ok.
- Double click the “SubnetMask” key.
- In the dialog box enter your additional subnet masks, making
sure each is on a separate line. Make sure you leave the first line
the same as it was. Click Ok.
- Close the editor.
- Back in Control Panel, Network Connections. Right-click the
connection, then select disable. Then enable.
- Verify your settings by running “ipconfig” as described
above.
Notes: If you define two IP addresses on one interface, only the
first is dynamically registered with the DNS server. Normally this
is not of concern as the first (or DHCP assigned) address is the
one you want registered in the name server. However to do this, you
need can create the MaxNumberOfAddressesToRegister in the registry
(at the same location as above) and set it higher than the default
of 1.
http://support.microsoft.com/kb/246804/en-us |