Netsh allows you to display or modify the network configuration of a computer that is currently running.
Netsh also allows you to run a group of commands in batch mode against a specified computer.
Netsh can also save a configuration script in a text file for archival purposes.
This feature helps you configure other servers.
How to save configuration :
1 | netsh -c interface dump > c:\interface.txt |
How to set the old configuration saved:
1 | netsh -f c:\interface.txt |
An example of input settings manually for static IP:
1 2 3 4 5 | netsh interface ip set address name = "Local Area Connection" source = static addr = 10.0.0.1 mask = 255.255.255.0 netsh interface ip set address name = "Local Area Connection" gateway = 10.0.0.4 gwmetric = 1 netsh interface ip set dns name = "Local Area Connection" source = static addr = 192.234.235.11 netsh interface ip add dns name = "Local Area Connection" addr = 192.234.235.12 netsh interface ip show config |
An example of input settings manually for dynamic IP:
1 2 3 4 | netsh interface ip set address name = "Local Area Connection" source = dhcp netsh interface ip set dns name = "Local Area Connection" source = dhcp netsh interface ip set wins name = "Local Area Connection" source = dhcp netsh interface ip show config |
You can create several such files for different network configurations.