0% found this document useful (0 votes)
174 views

IP Config and Routing On Windows in Command Line

This document provides instructions for configuring IP addresses, DNS addresses, and static routes using the netsh utility in Windows command line. It outlines how to set static or DHCP IP addresses and subnet masks for a local network interface. It also describes how to configure primary DNS, WINS addresses, and obtain addresses automatically from DHCP. Finally, it shows how to add, display, change, and delete static routes through commands like "route add", "route print", and "route delete".
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
174 views

IP Config and Routing On Windows in Command Line

This document provides instructions for configuring IP addresses, DNS addresses, and static routes using the netsh utility in Windows command line. It outlines how to set static or DHCP IP addresses and subnet masks for a local network interface. It also describes how to configure primary DNS, WINS addresses, and obtain addresses automatically from DHCP. Finally, it shows how to add, display, change, and delete static routes through commands like "route add", "route print", and "route delete".
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

 

Local Area connection Configuration using netsh utility and IP static routing in 
Windows command line 
 

Prepared By 
Vignesh Ramachandran 
Engineer – Server Management 
Email ID:‐ [email protected] 
 

Command to Configure IP address, WINS address and DNS address to the interface Named NIC 
(Default name is Local Area Connection) 

Syntax: 

netsh interface ip set address name=”<NIC card Name>”  source=<static> or <dhcp> <Ip address> 
<subnetmask> <gateway> <metric value> 

Configuring Static IP 

netsh interface ip set address NIC static 192.168.1.197 255.255.255.0 192.168.1.1 1 

or 

netsh interface ip set address name= NIC source=static  addr=192.168.1.197 mask=255.255.255.0 
gateway=192.168.1.1 gwmetric=1 

Configuring DHCP  

netsh interface ip set address NIC dhcp 

or 

netsh interface ip set address name=NIC source=dhcp 

Configuring Primary DNS Address 

netsh interface ip set dns  name= NIC source=static  addr=192.168.1.254 primary 

Or 

netsh interface ip set dns NIC static 192.168.1.254 primary 

Obtain DNS address automatically 

netsh interface ip set dns  name= NIC source=dhcp 

Or 

netsh interface ip set dns  NIC dhcp 

 
Configuring WINS Address 

netsh interface ip set wins  name= NIC source=static  addr=192.168.1.254  

Or 

netsh interface ip set wins NIC static 192.168.1.254  

Obtain WINS address automatically 

netsh interface ip set wins  name= NIC source=dhcp 

Or 

netsh interface ip set wins  NIC dhcp 

Static IP Route 

Adding a IP route 

Syntax: 

Route add <destination n/w> mask <destination n/w subnet mask> <gateway IP> metric <integer value> 
if <interface number> 

route add 192.168.2.0 mask 255.255.255.0 192.168.1.2 metric 3 if 1 

Displaying the route table 

route print 

Changing the IP route 

route change 192.168.2.0 mask 255.255.255.0 192.168.1.3 metric 2 if 1 

Deleting the IP route 

route delete 192.168.2.0 

You might also like