How to set a static IP address in Windows 11 using Powershell

Опубликовано: 26 Октябрь 2024
на канале: Onta Channel
507
2

Welcome to the onta channel.

To change the IP address to static using PowerShell, you can use the New-NetIPAddress cmdlet. This cmdlet is used to add a new IP address to the network adapter.

You can also use the Set-NetIPInterface cmdlet to change network interface properties, such as the IP address, subnet mask, and default gateway.
You must change the value of the -InterfaceIndex variable according to the index number of the network adapter used. You also need to adjust the value of the IP address, subnet mask, and default gateway according to your network configuration.

If you want to change the IP address of a dynamically assigned host to a static IP, you can use the Get-NetIPConfiguration and Set-NetIPAddress cmdlets.

The following is an example of a simple script for setting the IP address to static using powershell. Make sure that you have administrative privileges or have an account that has administrative privileges to run the command. :

1. Open powershell, run as administrator
2. Get-NetIPConfiguration
3. New-NetIPAddress -InterfaceIndex 10 -IPAddress 10.1.4.119 -PrefixLength 24 -DefaultGateway 10.1.4.1
4. Set-DnsClientServerAddress -InterfaceIndex 10 -ServerAddresses 10.1.4.1
5. Set-DnsClientServerAddress -InterfaceIndex 10 -ServerAddresses 10.1.4.1, 8.8.8.8

▶️ Check out other videos related to Windows 11:

1. Install windows subsystem for android on unsupported hardware (low end PC)
   • How To Install Windows Subsystem For ...  

2. How to activate and deactivate tab file explorer windows 11
   • Cara Mengaktifkan Dan Nonaktifkan Tab...  

3. How to install wireless display on windows 11
   • Cara Install Wireless Display Di Wind...  

4. How To Install Windows Subsystem For Android On Windows 11 22H2
   • How To Install Windows Subsystem For ...  

5. How to Download and Install Bluestacks on Windows 11
   • Cara Install Bluestacks Di Windows 11  

6. Review the experience of using Windows 11 on an unsupported PC
   • Review Pengalaman Menggunakan Windows...  

7. How to Activate Windows 11 Pro - Free and Legal
   • Video  

8. How To Upgrade Windows 10 To Windows 11 Without TPM 2.0 And Without Losing Data
   • Video  

9. How to check if your laptop or computer supports Windows 11 or not
   • Update Ke Windows 11 - Cara Cek Lapto...  

10. Setting IP Address in Windows 11
   • Cara Setting IP Address Di Windows 11  

11. Play Free Fire on Windows 10 - Memu Play the Lightest Android Emulator
   • Main Free Fire Di Windows 10 - Memu P...  

12. How To Download And Install VMware Workstation 17 Pro On Windows 11
   • How To Install VMware Workstation 17 ...  

This channel is about my activities in learning IT (Information and technology).
1. Blog : https://blog-onta.blogspot.com
2. Vlog :    / @qianaandfam  

Hopefully this channel can be useful for friends and me too.
Please support this channel and don't forget to click SUBSCRIBE, friends

Thank you very much.

#ontachannel
#windows11