(1)设置为DHCP自动分配

netsh interface ip set address "本地连接"  dhcp

netsh interface ip set dns "本地连接"  dhcp

(2) 设置为静态IP信息

netsh interface ip set address "本地连接" static  10.10.2.1 255.255.255.0 10.10.2.254

netsh interface ip set dns "本地连接" static 114.114.114.114

netsh interface ip add dns "本地连接" 8.8.8.8

(3)查看当前的IP配置信息

netsh interface ip show address/config/dns

(4)查看windows的网络配置文件

netsh -c interface dump

(5)批处理的形式

echo #设静态IP
netsh interface ip set address name="本地连接" source=static addr=192.168.1.1 mask=255.255.255.0
echo #设默认网关
netsh interface ip set address name="本地连接" gateway=192.168.1.254 gwmetric=0
echo #设首选dns
netsh interface ip set dns name="本地连接" source=static addr=192.168.1.10 register=PRIMARY
echo #设备用dns
netsh interface ip add dns name="本地连接" addr=192.168.1.20 index=2
netsh interface ip set wins name="本地连接" source=static addr=none
echo #
echo #显示“本地连接”配置结果
netsh interface ip show config 本地连接
echo #
echo # "本地连接" 的接口 IP  配置
echo #设自动获取ip
netsh interface ip set address name="本地连接" source=dhcp 
echo #设自动获取dns
netsh interface ip set dns name="本地连接" source=dhcp register=PRIMARY
echo netsh interface ip set wins name="本地连接" source=dhcp

echo #显示“本地连接”配置结果
netsh interface ip show config 本地连接
echo # 接口 IP 配置结束

(6)导出配置文件修改再执行导入

netsh interface dump>网络配置.netsh

修改“网络配置.netsh”文件,保留、修改其中需要的pushd及popd段,及段中需要的行。
以后再在需要时修改配置:
netsh exec 网络配置.netsh

netsh 网络配置.netsh

①追加
DHCP : netsh interface ip set address name=Adapter source=DHCP
ip : netsh interface ip add address name=Adapter addr=ip mask=maskip gateway=gatewayip
DNS : netsh interface ip add DNS name=Adapter addr=DNSip
WINS : netsh interface ip add WINS name=Adapter addr=WINSip

②修正
DHCP : netsh interface ip set address name=Adapter source=DHCP
ip : netsh interface ip set address name=Adapter source=STATIC addr=ip mask=maskip gateway=gatewayip
DNS : netsh interface ip set DNS name=Adapter source=STATIC addr=DNSip
WINS : netsh interface ip set WINS name=Adapter source=STATIC addr=WINSip

③删除
ip : netsh interface ip delete address name=Adapter addr=ip
DNS : netsh interface ip delete DNS name=Adapter addr=DNSip
WINS: netsh interface ip delete WINS name=Adapter addr=WINSip

windows 网卡配置的设置命令的更多相关文章

  1. zookeeper windows 下配置和基础命令

    原文链接:http://blog.csdn.net/woshioosm/article/details/45560177 1, 解压zookeeper ,在目录下建立文件夹 data 和log 2,在 ...

  2. linux下一个网卡配置多个IP

    转自:http://blog.csdn.net/beckdon/article/details/15815197 最常用的给网卡配置ip的命令为 #ifconfig eth0 192.168.0.1 ...

  3. [转帖]NM_CONTROLLED的含义以及网卡配置参数

    NM_CONTROLLED的含义以及网卡配置参数 https://blog.csdn.net/z1014347942/article/details/78069966 学习一下 其实可以手工修改的. ...

  4. jmeter 环境部署、数据库设置、分布式设置、多网卡配置等随笔

    <!-- linux系统修改系统环境变量  系统语言-->[root@web-249 ~]# env|grep LANGLANG=zh_CN.UTF-8[root@web-249 ~]# ...

  5. 转-Windows路由表配置:双网卡路由分流

    原文链接:http://www.cnblogs.com/lightnear/archive/2013/02/03/2890835.html 一.windows 路由表解释 route print -4 ...

  6. Windows路由表配置:双网卡路由分流

    一.windows 路由表解释 route print - ====================================================================== ...

  7. Centos7网卡配置命令nmcli

    在配置Centos6时,大家第一想到的就是把networkManager这个服务关掉,让它消失,这个服务台太鸡肋了,不该起作用的时候经常起作用,给管理带来了不便,但是在Centos7当中network ...

  8. VM虚拟机安装 常用Linux命令 网卡配置 (第二天)

    VM虚拟机安装:(昨天已经安装好了VM了,按照提示安装就好,很简单) 1.安装centos7虚拟机,现在磁盘里面新建文件夹作为安装文件夹 2.找到centos7的iso文件,打开vm-新建虚拟机-按照 ...

  9. centos6 网卡配置,多IP设置

    ##云服务器 centos6网卡配置 #设置出口IP vim /etc/sysconfig/network-scripts/ifcfg-eth0DEVICE=seth0 #网卡名称 BOOTPROTO ...

随机推荐

  1. Tensorflow学习笔记02-Session,Variable,placeholder

    Session会话控制 使用tensorflow创建两个矩阵,并使其相乘 matrix1=tf.constant([[3,3]]) matrix2=tf.constant([[2], [2]]) pr ...

  2. centos6下jbd2进程占用大量IO处理

    刚在尝试重现一个bug时,好像在killed mysql一段时间之后,io一直很高,如下: 12:40:01 PM CPU %user %nice %system %iowait %steal %id ...

  3. ql常见面试题 受用了

    //转至:http://www.cnblogs.com/GT_Andy/archive/2009/12/25/1921911.html 1. 用一条SQL 语句 查询出每门课都大于80 分的学生姓名 ...

  4. Vue 旅游网首页开发1-工具安装及码云使用

    Vue 旅游网首页开发-工具安装及码云使用 环境安装 安装 node.js node.js 官网:https://nodejs.org/en/ 注册码云,创建私密仓库存储项目 码云:https://g ...

  5. php5.3.x连接MS SQL server2008

    开篇 因为毕设老师需求的原因,虚拟旅游网站要求的数据库必须使用MS SQL server. 我最擅长的web编程语言是PHP,但是在PHP中链接MS SQL server是一件非常麻烦的事,我个人分析 ...

  6. 搭建ldap自助修改密码系统--Self Service Password

    系统版本:centos6 Self Service Password版本:1.1 服务安装: 安装依赖:yum install php70-ldap.x86_64 -y (版本尽量大于5.3,否则会提 ...

  7. topcoder srm 300 div1

    problem1 link 直接模拟即可. import java.util.*; import java.math.*; import static java.lang.Math.*; public ...

  8. topcoder srm 708 div1 -3

    1.定义一个字符串s,定义函数$f(s)=\sum_{i=1}^{i<|s|}[s_{i-1}\neq s_{i}]$,给定字符串$p,q$,定义函数$g(p,q)=\sum_{c='a'}^{ ...

  9. ODAC(V9.5.15) 学习笔记(四)TCustomDADataSet(1)

    1.SQL相关 名称 类型 说明 BaseSQL String 没有被AddWhere.SetOrderBy.FilterSQL等方法处理过的原始SQL语句 FinalSQL String 被AddW ...

  10. Python3 tkinter基础 Listbox Scrollbar 创建垂直滚动条

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...