How to configure TCP/IP settings from the Command Prompt in Windows

In order to configure TCP/IP settings such as the IP address, Subnet Mask, Default Gateway, DNS and WINS addresses and many other options you can use Netsh.exe.

With Netsh.exe you can easily view your TCP/IP settings. Type the following command in a Command Prompt window (CMD.EXE):

netsh interface ip show config

With Netsh.exe, you can easily configure your computer’s IP address and other TCP/IP related settings. For example:

The following command configures the interface named Local Area Connection with the static IP address, the subnet mask of, and a default gateway of

netsh interface ip set address name=»Local Area Connection» static 1 (The above is one long line)

If you want to export your current ip settings:

netsh -c interface dump > c:mySettings.txt 

If you want to import your ip settings:

netsh -f c:mySettings.txt

or instead of -f

netsh exec c:mySettings.txt

To automatically obatin an IP address using DHCP:

netsh interface ip set address «Local Area Connection» dhcp

DNS settings:

netsh interface ip set dns «Local Area Connection» static

WINS settings:

netsh interface ip set wins «Local Area Connection» static

Auto DNS settings:

netsh interface ip set dns «Local Area Connection» dhcp

Usefull links:

Link one and Link two

Cisco cli usefull key combinations

CLI Keys            Description

Ctrl + A            Beginning Line

Ctrl + B            Backward Character

Ctrl + C            Clear line

Ctrl + D            Delete Character to the Right

Ctrl + E            End Line

Ctrl + F            Forward Character

Ctrl + H            Backspace Character to the Left

Ctrl + I            Refresh Line and Goto End

Ctrl + J            Return

Ctrl + K            Delete everything on the Right of cursor

Ctrl + L            Refresh Line

Ctrl + M            Return

Ctrl + N            Next Command

Ctrl + P            Previous Command

Ctrl + R            Refresh Line

Ctrl + T            Flip Last 2 Characters

Ctrl + U            Clear Line and Put in Buffer

Ctrl + V            Allows A Control Character To Be Typed

Ctrl + W            Delete Word Backwards and Put in Buffer

Ctrl + X            Clear Line to the Left and Put in Buffer

Ctrl + Y            Paste Buffer Contents