Sometimes you need to use the Netsh tool to configure Windows system TCP/IPon specific occasions, which briefly describes common configuration commands.
1. Set the fixed IP address, subnet mask:
netsh interface ip set address name= " Local Area Connection "Source=static addr=192.168.0.12 mask=255.255.255.0
2. Set the default gateway:
netsh interface ip set address name= " Local Area Connection "gateway=192.168.0.254 gwmetric=0
3. Set the preferred DNS:
netsh interface ip set DNS name= " Local Area Connection "Source=static addr=192.168.0.1 register=primary
4. Set up alternate DNS:
netsh interface ip add DNS name= " Local Area Connection "addr=114.114.114.114 index=2
5. Set wins:
netsh interface ip set wins name= " Local Area Connection "Source=static Addr=none
6. Set the IP address to get automatically:
netsh interface ip set address name= " Local Area Connection "Source=dhcp
7. set up auto get DNS address:
netsh interface ip set DNS name= " Local Area Connection "Source=dhcp
8. Export the import configuration:
Export the TCP/IP configuration: NETSH-C interface IP dump > c:\tcpip.txt
Import TCP/IP configuration: netsh-f c:\tcpip.txt
Note:
the above command can be combined abbreviated as: netsh interface ip set address " Local Area Connection "static 192.168.0.12 255.255.255.0192.168.0.254 0
the above command 3 can be abbreviated as: netshinterface IP Set DNS " Local Area Connection "static 192.168.0.1 Other command abbreviations are similar.
This article is from the IT Operations blog, so be sure to keep this source http://itops.blog.51cto.com/2420369/1858746
Configuring Windows system TCP/IP with the Netsh tool