Windows 2008 Server Core : Using netsh to configure TCP/IP

Windows 2008 Server Core : Using netsh to configure TCP/IP

List all ipv4 interfaqces and obtain the interface ID of the NIC you wish to change the configuration for, in this instance we will modify the settings of interface ‘10‘ which is shown as ‘connected’:
  netsh interface ip show interfaces

 

Set DHCP for ipv4 interface ’10’:
  set address 10 dhcp

Set Static IP Address/subnet mask/gateway on ipv4 interface ’10’:
  set address 10 static 192.168.1.100 255.255.0.0 192.168.1.1

Set primary and secondary DNS servers for ipv4 interface ’10’:
  set dnsservers 10 dhcp
  set dnsservers 10 static 192.168.1.10 primary
  add dnsservers 10 192.168.1.11

Set WINS servers for ipv4 interface ’10’:
  set winsservers 10 dhcp
  set winsservers 10 static 192.168.1.10
  add winsservers 10 192.168.1.11

Reset TCP/IPv4 stack:
  netsh interface ip reset