The Realm of the Verbal Processor

Jarvis's Ramblings

Command Line IP Configuration

Had a situation this week where I needed to configure IP address, IP Gateway, DNS, Subnet Mask, and DNS Suffix from the command line. Not hard once you have the commands. Putting it here as a reference for myself and others. Here are the three commands for doing this…be careful of line wrapping.

netsh interface ipv4 set address name="local area connection" source=static address= mask= gateway=

netsh interface ipv4 add dnsserver name="local area connection" address= index=1

reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters /v "SearchList" /d "" /f

September 14, 2012 - Posted by | Misc, scripting

1 Comment »

  1. You can also launch sconfig.cmd and borrow that interface, unless you’re scripting it with other activities.

    Comment by Bryan | September 17, 2012

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: