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=10.10.0.100 mask=255.255.0.0 gateway=10.10.0.254

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

reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters /v "SearchList" /d "domain.com" /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:

WordPress.com Logo

You are commenting using your WordPress.com 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: