[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 208
  • Last Modified:

Commands for adding / removing IP addresses to / from NIC Windows 200x server?

How can I add / remove an IP address to / from a NIC interface using command line?
0
EIW
Asked:
EIW
1 Solution
 
GovvyCommented:
netsh interface ipv4
0
 
Gary ColtharpSr. Systems EngineerCommented:
netsh interface ip add address name="Interface Name" addr=x.x.x.x mask=x.x.x.x

to remove them, just replace add with delete
0
 
Rob WilliamsCommented:
Careful doing so if your server is a DNS server:

To add you can use from a command line or use a batch file as per below to completly configure a NIC;

***************************************************
rem Reset network Settings for static IP
netsh interface ip set address name = "Local Area Connection" source = static addr = 10.0.0.99 mask = 255.255.255.0
netsh interface ip set address name = "Local Area Connection" gateway = 10.0.0.254 gwmetric = 1
netsh interface ip set dns name = "Local Area Connection" source = static addr = 4.2.2.2
netsh interface ip add dns name = "Local Area Connection" addr = 4.2.2.3
netsh interface ip show config
pause
 
*************************************************
 
rem Reset network settings for DHCP
netsh interface ip set address name = "Local Area Connection" source = dhcp
netsh interface ip set dns name = "Local Area Connection" source = dhcp
netsh interface ip set wins name = "Local Area Connection" source = dhcp
netsh interface ip show config
pause
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now