时间:2018-03-13 15:41
小编:易激活
-
如果需要配置为静态ip地址,dns服务器
1. 查看自己的ip地址
找到本地连接
右键属性,查看ip4 协议(ip6协议本人尚未试过)
2.新建文档键入如下信息:
netsh interface ip set address "本地连接" static aaa. aaa. aaa. aaabbb. bbb. bbb. bbbccc.ccc.ccc.ccc
netsh interface ip set dns "本地连接" static ddd.ddd.ddd.ddd
-
3. 其中aaa.aaa.aaa.aaa为ip地址
bbb.bbb.bbb.bbb为子网掩码
ccc.ccc.ccc.ccc为网关地址
ddd.ddd.ddd.ddd 为dns地址
4.将文档保存为bat格式,名字自选存放在方便的地方
5. 右键点击该文档,选择以管理员身份运行。win7弹窗时允许它运行。
6.可以检查ipconfig是否已经修改完。
-
如果需要配置为动态ip地址,dns服务器
其余过程一样。只是文档中的信息改为:
netsh interface ip set address "本地连接" dhcpnetsh interface ip set dns "本地连接" dhcp
netsh interface ip set wins "本地连接" dhcp
-
如果需要增加备用dns,则在文档里面加入一行
netsh interface ip add dns "本地连接" 8.8.8.8
-
其中8.8.8.8为google的dns,可以改为所需要的备用dns
建立了需要的bat之后就可以方便的切换了。