PDA

View Full Version : DHCP and static IP's on one LAN (All)



markt1964
10-07-2006, 02:41 PM
I have several computers running various OS's on my home LAN, with most of them receiving a dynamic IP via DHCP from my ISP's DHCP server. Some of my computers do not receive a dynamic IP, but use a static IP in the 192.168.0.* range. These computers do not need to access the internet, but I cannot ping them or establish any connection to them from the other computers on the LAN unless I logically multihome other computers to have their own unique 192.168.0.* address. This is no problem at all for the Unix systems on the lan, I can just add an IP alias for the interface with ifconfig. Neither is it a problem for the Windows 2000 systems on my lan, as I can append the static IP and appropriate subnet mask to the registry entries IPAddress and SubnetMask, respectively, located in HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Param eters\Interfaces\{adapterid}\.

However, this approach does not work on either of the XP home systems on my LAN. What happens when I make the above changes to the registry (regardless of whether I just disable and re-enable the network connection or do a complete reboot) is that XP reports that DHCP was unable to acquire an address and the network offers "limited connectivity". Ipconfig reports 2 IP addresses for the NIC, one of them an actual DHCP assigned address (in spite of what XP reported), and the other is always 0.0.0.0 with a subnet mask of 0.0.0.0. This happens regardless of whether I append or prepend my static IP and subnet mask to the registry strings above. Internet connectivity functions normally on these systems, but they still cannot connect to the static IP's on the LAN.

On the XP systems, whether I've tried to multihome them as described above or not, Tracert indicates that when trying to ping one of the static IPs on the LAN, it always follows the default gateway, which I think may be where the problem lies, but I don't know how to make XP use anything but the default gateway for IP's that are not on the same logical subnet.

I just want the XP systems to be able to see the static IP's on my LAN like most of the other computers can while still collecting dynamic address from the ISP's DHCP server.

Suggestions, anyone?

windowcleaner
10-09-2006, 02:08 PM
Just so i am clear on this, are you saying that each of your computers is receiving a PUBLIC IP ADDRESS from your ISP or do you have a ROUTER which gets a dynamic ip address from your ISP and in turn your router is set to hand out 192.x.x.x addresses?

Why are you adjusting the registry to change IP addresses?

markt1964
10-09-2006, 04:01 PM
No... my router isn't handing out any addresses. I need to run certain services on some of the computers that necessitates that they have public IP's. Port forwarding isn't an option because some of the same services, which do not appear to be configurable with regards to the ports they operate on, are needed on multiple computers simultaneously. My router is configured to not collect a dynamic address from my ISP at all, but just act as a simple switch with no MAC of its own (except when accessed from the 192.168.0.* domain).

I adjusted the registry on the windows 2000 systems to add a static IP in the 192.168.0.* range because there was no other way in Windows that I could discover to give a single nic a second static IP when it was already configured to retrieve an IP by DHCP. The technique that works in Win2k does not work on XP home, however. If an adapter is configured to use DHCP in XP, I cannot find any way to get it to take a second static IP on the same physical interface. On Unix systems, this was trivial, using a one-liner startup script "ifconfig eth0:0 192.168.0.xxx;ifconfig eth0:0 up", which accomplishes this perfectly... it adds an IP address alias to the interface without shutting down the interface, or affecting anything other IP's already on the interface, so this is not a hardware limitation. Win2k also has the ability to do it, but as I've described, it's a bit more complicated.

windowcleaner
10-10-2006, 11:14 AM
Within XP you can add an alternate IP address if the device is used on different networks. Just go to the properties of TCP/IP and there will be a tab that says ALTERNATE CONFIGURATION.

Good Luck.. sounds you got your hands full there!

markt1964
10-10-2006, 11:20 AM
I actually already tried that. It doesn't appear to do anything at all. It still only has one IP address... the one retrived from DHCP.

This is so darn frustrating that just the two XP systems on the lan are causing me grief.

windowcleaner
10-10-2006, 12:32 PM
Is assigning fixed IP's to the XP Pc's not an option?

markt1964
10-10-2006, 12:36 PM
No.... the XP machines need to collect their IP via DHCP. The IP's change often enough via DHCP that it would be a hassle to manually change them every time the DHCP lease is renewed.

windowcleaner
10-10-2006, 01:24 PM
Have you tried the ROUTE ADD -P command?

EXAMPLE:

route ADD 157.0.0.0 MASK 255.0.0.0 157.55.80.1
destination^ ^mask ^gateway

This might be what your looking for if you want to pass your traffic thru a default gateway rather than the assigned one thru DHCP.