navigation

How to configure TCP/IP using CMD command on Windows

Configuring TCP/IP with CMD commands helps network administrators easily control IP, DNS and DHCP settings without a graphical interface. Netsh is a powerful tool that supports network connection management, system optimization and quick troubleshooting.

Instructions for using Netsh to set up TCP/IP on Windows, from setting static IP, enabling DHCP to configuring DNS. Useful solution for administrators and advanced users.

Configure TCPIP using Cmd command

Step 1 : First, open CMD and then enter the netsh command to use Netsh.exe.

Picture 1 of How to configure TCP/IP using CMD command on Windows

To set up TCP/IP you enter the command.

netsh interface ip show config

Picture 2 of How to configure TCP/IP using CMD command on Windows

To set a static IP, enter the command.

set address local static 192.168.2.2 255.255.255.0

In which 192.168.2.2 is the IP, and 255.255.255.0 is the subnet mask

Picture 3 of How to configure TCP/IP using CMD command on Windows

To set up DHCP mode you enter the command.

set address name= 'Local Area Connection' source=dhcp

Picture 4 of How to configure TCP/IP using CMD command on Windows

To configure DNS you enter the command.

set DNS 'Local Area Connection' static 192.168.2.1

Where 192.168.2.1 is the DNS address.

Picture 5 of How to configure TCP/IP using CMD command on Windows

To exit the netsh.exe environment you type.

exit

Picture 6 of How to configure TCP/IP using CMD command on Windows

If you want to check TCP/IP information using CMD command, you use the command.

ipconfig /all

Picture 7 of How to configure TCP/IP using CMD command on Windows

You can use Netsh to configure TCP/IP on Windows flexibly, from setting static IP, enabling DHCP to editing DNS. If you need to manage the network system in depth, CMD commands will help  check IP addresses  quickly and accurately.

Update 05 March 2025