HOWTO: Set up a Static IP on Multiple Platforms
June 04, 2013
I am running a Linux box, Android tablet and Windows 7 laptop on the same wireless router. Surprisingly or not, the joker in this deck is the Windows 7 laptop. By 'joker' I mean that the Linux box and Android tablet are perfectly capable of obtaining a router selected IP address, each and every time, and going online without further assistance. The Windows 7 laptop, part of the time goes online, and slightly more often fails to go online with the error that there is an IP conflict, and to contact my network administrator. Well, I am my network administrator, so I will be addressing this issue today.
The reality is that your network is only as nimble as the weakest link. If it is necessary to make adjustments to accommodate the one weak link, all aspects of the network must take that into account. So, to accommodate the tendency of the Windows 7 machine to be unable to acquire a dynamic IP address, we want to change all systems to have a static IP address. That is to say, we assign an IP address to each machine rather than letting the router do it for us.
First, let's look at the Linux box. Note that the exact screens may be different as the graphical user interface (GUI) chosen by Linux users varies. This GUI is Gnome 2 in CentOS 6. Start by bringing up the current IP information.
There are several things we want to pay attention to here:
The default Method here was DHCP (Dynamic Host Configuration Protocol) which means let the router decide about IP addresses. DHCP provides an IP address automatically to your various connected devices, but not all of the machines connected to the router can handle that method in our scenario. So we do the following:
We are going to take a quick but very important detour here. Note that the DNS servers have been filled in with 220.127.116.11 and 18.104.22.168. DNS stands for Domain Name Server or Domain Name Service. DNS is like a phone book, which looks up a web address, for example, www.yahoo.com and 'resolves' it into an IP address (for example 22.214.171.124) that a computer can understand. In the above example DNS Servers 126.96.36.199 and 188.8.131.52 are the phone book in which the IP address is 'looked up'. The DNS servers 184.108.40.206 and 220.127.116.11 belong to a free service called OpenDNS. It has the advantages of being supported by many third party utilities, registration is free, and as or if you decide to pursue tuning your internet connection in the future, OpenDNS provides online tools to do so.
There is also another huge advantage to using OpenDNS for domain name resolution. If you are connecting to the internet with your cable provider, your DNS requests are resolved by their DNS server by default. If your cable goes out and you tether with a smartphone in a pinch to get online, your DNS requests...go to the cable company's DNS server, which refuses the requests since it detects an address outside of its known address range (not surprising, since the address sending the requests is a mobile carrier's IP address). The same is true in reverse. If you change your DNS server to match the mobile carrier's DNS servers, when your cable comes back up, requests for address resolution are still going to the mobile carrier's DNS server...and are likewise refused, and for the same reason (the address sending the requests to the mobile carrier's DNS server is coming from a cable company's IP address now).
Using OpenDNS bypasses this problem. The OpenDNS server is a third party DNS server, it is not the cable company's nor the mobile carrier's DNS server. As a consequence, it does not care about who the address of the originating device belongs to. It resolves the IP address either way. So you can switch back and forth between tethered smartphone as modem or your cable or DSL as often as you like without having to go in and change DNS server settings ever. It is not required in our settings in the above example, but it simplifies matters in the long run. In fact, it so simplifies matters, that we will be using OpenDNS to resolve addresses for all of the devices we will be setting up.
Now we will set up the Windows 7 laptop the same way. If you did not have a Linux box handy to get your current settings, in Windows 7, do this:
By default, Windows wants to Obtain an IP address automatically. But we know Windows is having trouble doing this reliably. So do the following:
Last we set up the Android tablet. This was done on major version Eclair, but the underlying concept is the same across versions.
By now this should look pretty familiar. Fill in the values as with the other computers.
Share this on witter or acebook.