How to set up a static IP on Windows

How to set up a static IP on Windows



Windows, like almost all modern operating systems, relies on a protocol called DHCP to obtain an IP address. When a Windows machine connects to a wired or Wi-Fi network, it sends a request to the DHCP server which is generally run by the router to which the PC has been connected; this will provide an address that will identify the PC within the local network, all automatically and transparently to the user. Some more sophisticated routers can do something more thanks to DHCP Lease, a feature that keeps track of which IP has been previously assigned to a particular machine and tries to reserve it for a customizable period of time. In domestic and entry level devices, such as those supplied by internet providers, this parameter is set by the manufacturer and cannot be customized.

If on the one hand the automatic assignment of IP addresses via DHCP guarantees the security clients connected to the network can surf the internet without IP conflicts there could be disadvantages such as being assigned a different IP to a machine that shares resources (files, folders or devices) making it no longer reachable from other devices.

Therefore, configuring a PC to use a static IP address therefore allows you not to run this risk, the machine will present itself to the router no longer negotiating a random address but expressly requesting one, the downside is that some tricks will be needed which we will tell you about after to be sure that everything works automatically, especially in the case of mixed networks where some devices i use DHCP, while others use static IPs.

How to Set a Fixed IP in Windows

The procedure for setting a fixed IP is relatively simple. First we have to open the control panel: just click on the start button and write "panel", the Windows search will do the rest. Simply press Enter or click on "open".

How to quickly open the control panel

Continuing on "Network and Internet" and then "network and sharing center", there we will find this screen:



Control panel, network and internet At this point , clicking on "Ethernet instance 0" (the name may change according to your hardware) will open a new window where the status of our connection will be shown.



Control Panel - Connection Status Click on the "properties" button at the bottom right to obtain the list of possible settings for the connection.



Control Panel - Card Options At this point click on “Internet Protocol version 4 (TCP/IPv4)” in “Properties – Ethernet Instance 0” to get to the mask where it will be possible to manually enter IP and DNS, as well as obviously the other network parameters.



Static IP Setting, Example Configuration Here is a brief explanation of what the various items are:

IP address: it is the address that we are going to assign to the PC in our network, it must be unique and not used by other devices. Subnet Mask: it is a parameter provided by the router, you can learn more at this address  or use this tool to calculate yours, or obtain it from Windows. Gateway : is the device that takes care of connecting your network to the world. The address to enter will be that of your router, you can learn more here. Primary and secondary DNS: DNS is responsible for translating a human-understandable URL into an IP address that the network understands. You can use those of your internet provider by entering the IP of your modem, or use custom ones such as those of Cloudflare or Google. The parameters we enter are generic and only examples and may not work for your network. You can obtain a basis of valid parameters by clicking on "details" in the connection properties window.

Control Panel - Connection Status

Useful Tips

Avoiding IP conflicts

Configuring a machine with a static IP could create problems if the network is mixed. Some medium and high-end routers allow you to set their DHCP server not to provide addresses in a certain range, for example the first 10 (from 192.168.1.2 to 192.168.1.12), so that they always remain free for our devices with Static IP. In the absence of this function, combined with a very low DHCP lease setting (as internet providers often do in their devices), a first come first served problem will arise, i.e. our router will assign the first free IP available to the first machine that requests it.

Let's take an example. We have a Desktop PC with a static IP set to 192.168.1.2, which shares folders on the network, turned off. We connect a new device to the network that has DHCP active and asks the router for an IP; the router assigns it the first available one, which will be 192.168.1.2, free precisely because the desktop PC is off. The IP conflict problem will arise when we turn on the desktop PC, which will detect an IP conflict and will not be able to browse or share files on the network.

The solution is simple: if it is not possible to configure the modem, just assign the static IPs of our devices pointing to "high" addresses, but still within the expected range. For example, we could start from 192.168.1.50 and go up, thus avoiding possible conflicts.

Use a custom DNS

By setting a static IP we will also have to manually specify a DNS and this could be a good opportunity to make our connection faster and more secure, also unblocking some sites that the internet provider has chosen to block.

these are some DNS alternatives to consider:

Google: 8.8.8.8, 8.8.4.4. They are very fast and free, they do not offer ad blockers and malicious sites. CloudFlare : 1.1.1.1 , 1.0.0.1. They are the fastest DNS to date according to DNSPerf, they offer anti tracking protection. ClooudFlare for Families : 1.1.1.2 , 1.0.0.2 for Malware protection and 1.1.1.3, 1.0.0.3 for Malware protection and adult site blocking. Comodo DNS: 8.26.56.26, 8.20.247.20. They promise the removal of national blockades and great speed. More advanced users might consider building a dedicated DNS server at home thanks to projects like PiHole and AdGuard Home. Here you can find our guide on how to install PiHole on any x86 PC, converting it into a private DNS server.

You did something wrong and you can no longer surf

No problem, do something wrong it will not have disastrous consequences on your PC, which will simply be unable to navigate. You can repeat the configuration by fixing the incorrect parameters, or run for repairs thanks to the Windows troubleshooter that will restore the network to its original state with DHCP active.









Powered by Blogger.