Skip to content
DG David Galiata
microsoft networking windows netsh

Configure NIC From CMD Line

Quickly go from a DHCP address to Static via command line.

D

David Galiata

1 min read
Configure NIC From CMD Line

Often I work with network devices locally that require a static IP address. Once I am done I usually need to set my network adapter back to DHCP. I recently created a batch file to save me the hassle of going back to “Control Panel”, etc.

netsh interface ip set address “Local Area Connection” dhcp netsh interface ip set dns “Local Area Connection” dhcp

You can also use netsh to set a static IP address if you’d like.

Terminal window
netsh interface ip set address "connection name" static
192.168.0.101 255.255.255.0 192.168.0.1
netsh interface ip add dns "connection name" 8.8.8.8
Back to Blog
Share:

Follow along

Stay in the loop — new articles, thoughts, and updates.