The moment the computer is connected to a network, it’s going to receive a dynamic IP address from the DHCP server. As the name (Dynamic IP) suggests a simple restart, or a simple tweaks on the settings can change the IP address. In the end it can cause issues like port forwarding, remote desktop may stop working. However if your computer has a static IP address, it’s going to always maintain the same IP address making it ideal for the services on the network. So now you know that the static IP address is an IP that never changes unless you change it manually. It means it’s going to make it a preferred option for sharing files, printing on the local computer, configuring ports for remote control and other stuff. The question is how to assign a static IP address in windows 11/10.
Apparently there are four methods in windows that you can assign a static IP address and they are listed below.
- Use CMD to set a static IP address.
- PowerShell is other option that can be used to assign a static IP address.
- Control panel, the old method that you can use to set a static IP address.
- Finally you can set a static IP address using the settings app.
Feel free to use any of these methods that you are comfortable with for assigning a static IP address.
Assign a Static IP Address using CMD
Click on the search icon at the taskbar, then search for CMD, after showing the result, Run CMD as Administrator.
In the CMD panel type ipconfig /all
and Press Enter.
When the result appears> first choose one of the Network Adapters that you want to set a static IP address for. In my case the I will configure the Ethernet adapter. Under the network adapter find the IPV4, Subnet Mask, Default Gateway and DNS Server.
Once you find these details, keep them in your mind or copy them into a Notepad. And also please keep in mind that my computer’s current IP Address is 192.168.10.13
To Assign a Static IP, execute the below command in CMD.
- Instead of “Ethernet” in command, replace it with the adapter that you want to configure.
- 192.168.10.12 is the IP that I want to Set for this computer, you have to type the IP that you want.
- 255.255.255.0 is the subnet mask that you are getting from the router.
- 192.168.10.1 is the default Gateway of my router.
netsh interface ip set address name="Ethernet" static 192.168.10.11 255.255.255.0 192.168.10.1
You can run the below commands to set a DNS server and an alternative DNS to the adapter.
netsh interface ip set dns name="Ethernet" static 192.168.10.1
netsh interface ip add dns name="Ethernet" 8.8.8.8 index=2
Once everything is done, using ping to check if you have access to the Internet or no.
Set a Static IP Address using PowerShell
The other method that you can use to Assign a Static IP Address in Windows 11 is to use the PowerShell. It is also quite powerful and every IT user must know it.
For the first step, launch the PowerShell as Administrator.
You have to asses the current network settings and configuration. Just as you typed IPconfig /all in the CMD, you have to execute the below command in the PowerShell.
Get-NetIPConfiguration
You can also use the ipconfig but it is good to evolve over time.
Once the above command is executed, Find the Adapter that to set a Static IP address for it. After finding the Adapter, you have to gather following information and copy them into Notepad.
- Adapter: Ethernet
- InterfaceIndex: 3
- IPv4Address: 192.168.10.11
- IPv4DefaultGateway: 192.168.10.1
- DNSServer: 192.168.10.1
- AlterDNS: 8.8.8.8 (If available)
After gathering the required data, bring changes to the below command and execute it in the PowerShell.
In the below command:
- Replace 3 with your Interface Index ID.
- Instead of the 192.168.10.15 type your own IP Address.
- Replace the DefaultGateway IP address too.
New-NetIPAddress -InterfaceIndex 3 -IPAddress 192.168.10.15 -PrefixLength 24 -DefaultGateway 192.168.10.1
Note: If you face the below error on the PowerShell, execute the below command.
New-NetIPAddress -InterfaceIndex 3 -IPAddress 192.168.10.15 -PrefixLength 24
Also by executing the below commands you can set a new DNS Server for your machine.
Set-DnsClientServerAddress -InterfaceIndex 10 -ServerAddresses 10.1.4.1
Set-DnsClientServerAddress -InterfaceIndex 10 -ServerAddresses 10.1.4.1, 8.8.8.8
Assign a Static IP Address using Control Panel
The old method to assign a static IP address through the control panel is still available. In fact it is like one of the quickest method that you can use to assign an IP address to any computer even the server.
Without wasting lot of time let’s begin and set a static IP address through the control panel. For the first step you have to press Windows + R on the keyboard, this is going to open the run dialog box. In the run dialog box, you have to type ncpa.cpl and press enter.
Once the network connections are opened, you have to right click on the adapter that you want to set a static IP address for it. In my case the Ethernet is the one which has to be set with the static IP address. Double-click or right-click on the adapter and choose Properties.
On the next window double click on the “Internet Protocol Version 4 (TCP/IPv4)“> after choose “Use the following IP Address“. There you have to insert the details regarding to the static IP Address.
Set a Static IP Address using Settings
The final method that you can use to set a static IP address in windows is to use the settings application. In fact the settings app provides more options and features compared to the control panel, CMD and PowerShell.
To assign a static IP address in windows 11 through the windows settings app, you have to open the settings. Then go to network and Internet category, after that you have to choose Ethernet or Wi-Fi. I will go with Ethernet.
Find the IP assignment> Infront of it click on the edit.
A new window will open, by default the automatic DHCP is selected, you have to change it to manual.
Toggle the IPv4 to turn it on.
Now Go ahead and enter your IP, Subnet Mask, Default Gateway, preferred DNS, and if you want to encrypt it, do it too. Once you are done with configuring the settings> save the changes.
Now have a look at the changes that you brought the network.
Conclusion:
Static IP address is really helpful whenever you are on the network and you are attempting for file sharing, remote desktop, printer and other stuff. While at the same time the dynamic IP address is not really helpful because a small restart can cause a lot of problems.