11lxm 发表于 2018-6-19 12:28:45

利用netsh工具配置Windows系统TCP/IP-IT运维

  在特定场合有时需要使用netsh工具配置Windows系统TCP/IP,下面简要说明常用配置命令。
  1.设置固定IP地址、子网掩码:
  netsh interface ip set address name="本地连接"source=static addr=192.168.0.12 mask=255.255.255.0
  2.设置默认网关:
  netsh interface ip set address name="本地连接"gateway=192.168.0.254 gwmetric=0
  3.设置首选DNS:
  netsh interface ip set dns name="本地连接"source=static addr=192.168.0.1 register=primary
  4.设置备用DNS:
  netsh interface ip add dns name="本地连接"addr=114.114.114.114 index=2
  5.设置WINS:
  netsh interface ip set wins name="本地连接"source=static addr=none
  6.设置自动获取IP地址:
  netsh interface ip set address name="本地连接"source=dhcp
  7.设置自动获取DNS地址:
  netsh interface ip set dns name="本地连接"source=dhcp
  8.导出导入配置:
  导出TCP/IP配置:netsh -c interface ip dump > c:\tcpip.txt
  导入TCP/IP配置:netsh -f c:\tcpip.txt
  备注:
  上述命令1,2可合并简写为:netsh interface ip set address "本地连接" static 192.168.0.12 255.255.255.0192.168.0.254 0
  上述命令3可简写为:netshinterface ip set dns "本地连接" static 192.168.0.1 其它命令简写类似。
页: [1]
查看完整版本: 利用netsh工具配置Windows系统TCP/IP-IT运维