Setting network configuration from a command prompt

NetSh is an excellent command line tool that exposes pretty much every configuration option available from the UI in the form of a command-line tool.  It's also scriptable.


Its command structure is similar to that of the Cisco IOS shell on routers and switches.  You switch to the context of the device/port/setting you want to configure then execute a command to configure it.  E.g., to set an interface to a static IP, you would:


interface ip

set address "Local Area Connection" static


interface ip switches you into that context (configuring tcp/ip for interfaces).  set address is a command available in that context.


To view the existing configuration for all interfaces use the show config command from the interface ip context, e.g:


interface ip

show config



No comments:

Post a Comment