Netsh.exe is a powerful command line tool you can use to configure and manage multiple network connections, quickly and easily from the command line. Netsh allows for complete configuration of the network card(s) from the command line.
Lets start by checking out the current configuration of the Local Arean Connection with this command:
- netsh interface ip show address "Local Area Connection"
We can change the IP address as well. The following command will set the IP address to 192.168.0.10, on the 255.255.255.0 subnet, with the gateway IP of 192.168.0.1
- netsh interface ip set address name="Local Area Connection" 192.168.0.10 255.255.255.0 192.168.0.1 1
Alternatively, if we want the adapter to use DHCP to obtain its network information, run the following command:
- netsh interface ip set address "Local Area Connection" dhcp
Now if you are like me, you travel with a laptop between work and home. You can easily dump your adapter settings to a text file and import them quickly and easily with the following two commands:
- netsh -c interface dump > c:\ipconfig.txt
Now, whenever you need to quickly import your IP settings
- netsh -f c:\ipconfig.txt
0 comments:
Post a Comment