Setting Static IP addresses on your network

by Stumpy842

After reading the article "How to Set up a Printer in a Windows Workgroup" in the December issue of PCLinuxOS Magazine, there is an additional consideration I would like to address. Most Windows machines in a typical home network (that is, several systems connected to a router/Internet gateway) will be set to use DHCP to obtain an IP address on the network automatically. This is the default for Windows unless changed by the administrator. Unfortunately, this means that each time a particular machine is booted up it will possibly get a different IP address, depending on how many other machines are already assigned on the network. The solution is to use static IP addresses for all the machines on your network.

However, trying to set up Windows to use static IP addressing is often a hit or miss situation. Many times when doing this the various machines will not even "see" each other on the network, depending on factors such as which machine has been up and running longer, is acting as the master browser, and so on. I have found it to be a better solution to use the configuration screens in the router to establish a static IP for each machine on the network permanently, and leave DHCP running to catch any other systems which might walk in the door and end up plugged into the network temporarily.

To check your IP settings in Windows XP, open the Control Panel. If you are in Category View, click the Network and Internet Connections category, then Network Connections icon. If you are in Classic View, click the Network Connections icon. Right-click on the icon for your adapter and click Properties. In the Properties dialog double-click on Internet Protocol (TCP/IP). In the Internet Protocol (TCP/IP) Properties dialog the default settings are Obtain an IP address automatically, and Obtain DNS server address automatically.

To assign a static IP address to this machine on the network, you would select Use the following IP address, and enter appropriate values for IP address, Subnet mask and Default gateway.

Each machine on the network needs a unique IP address, so be sure to change the last number (ie. 100, 101, 102 etc) for subsequent machines when assigning addresses. The Default gateway is the IP address of your router, usually or similar. Also, note that selecting Use the following IP address automatically selects Use the following DNS server addresses. This means you will need to enter a value for Preferred DNS server and optionally Alternate DNS server. These can be obtained from the Status page of your router's configuration screens, or from your Internet service provider.

Along with the possible problems I mentioned with this method earlier is the fact that Internet service providers often change their DNS server numbers, and generally do not tell their customers when they do so. This would mean having to change each machine's DNS server numbers each time this occurred. Failure to do so would result in the machine not being able to access the Internet (unless you entered the actual IP address of the website you want into the address bar in your browser).

A better alternative to this approach is to let the router itself assign static IP addresses to each machine that is a permanent system on your network. This only needs to be done once and avoids the pitfalls of having the DNS servers change. Here is an example of my router, a D-Link DI-604.

Each machine on the network is identified to the router by its MAC address, a unique string encoded in the Ethernet adapter. So to assign a static IP for a machine, you need the MAC address of its Ethernet adapter and its host name. In the DI-604 you can find this info by viewing the Log pages on the Status screen.

Here we can see the machines pclos93 and stevexp with their corresponding IP and MAC addresses. If your router does not show this information, you can get the MAC address of your Windows machine by Clicking Start > Run and typing cmd, then at the command prompt type ipconfig /all. The host name is shown under the Windows IP Configuration section and the MAC address is shown as Physical Address under the Ethernet adapter section. On PCLinuxOS you can get the MAC address by running KDE Control Center, expanding the Information heading and selecting Network Interfaces. The MAC address is shown under the HWaddr column entry of your adapter, typically eth0. An alternative method is to run PCLinuxOS Control Center and select Networking then Reconfigure an existing network interface. When the Manage Connections window opens, select your adapter from the dropdown list and then click the Information tab. The host name can be found by opening a terminal and typing hostname. If your hostname is localhost and you would prefer another name, I refer you to this thread on the PCLinuxOS Forums, "How do I set the machine name?"

See Reply #12 by EvenFlow for info on the changes you need to make.

Armed with this info you can use your router's configuration screens to assign permanent addresses to the machines on your network. Refer to the documentation for your router to apply this technique. I believe most newer routers support assigning static IP addresses on the network.