0

I am running currently windows 10 with a DHCP assigned network address. I want to change this (and I know how to do it via GUI), but I am wondering how could i change the network address via command line? (I'd to automate this in a setup)

Mandragor
  • 103
  • 4
  • Dupe https://superuser.com/questions/996130/how-do-i-set-a-static-ip-address-in-windows/#996144 and https://superuser.com/questions/1213464/how-to-configure-network-connection-ip-and-dns-with-script – dave_thompson_085 Oct 27 '20 at 15:13

1 Answers1

1

This will do your IP Address

netsh interface ipv4 set address name="Wi-Fi" static 192.168.3.8 255.255.255.0 192.168.3.1 

This will do your DNS

netsh interface ipv4 set dns name="Wi-Fi" static 8.8.8.8
netsh interface ipv4 set dns name="Wi-Fi" static 8.8.4.4 index=2
  • Uses the interface name “Wi-Fi”
  • Sets the IP address to 192.168.3.8
  • Sets the subnet mask to 255.255.255.0
  • Sets the default gateway to 192.168.3.1
  • Sets DNS Server 1 to 8.8.8.8
  • Sets DNS Server 2 to 8.8.4.4
SQLTemp
  • 1,452
  • 2
  • 10
  • 22