Friday, March 1, 2013

Configure Network Adapter from command line

Here is another useful DOS command  to add to the list, NETSH. If you want configure a network adapter this is the great way to automate it.

To set the address of a Network Adapter you use the set command like this:
NETSH interface ip set address name="Local Area Connection" static 192.168.0.101 255.255.255.0 192.168.0.1 1

Now lets rename it so we don't have to do so much typing.
NETSH interface set interface name="Local Area Connection 2" newname="Looper"

Let say you want to do something fun like add multiple IP's to the loopback adapter, for that you use the add command
NETSH interface ip add address name="Looper" static 192.168.0.102 255.255.255.0
NETSH interface ip add address name="Looper" static 192.168.0.103 255.255.255.0