Windows下通过脚本快速修改IP地址

简介: Windows下通过脚本快速修改IP地址 如果通过Windows的网络属性修改Ip/网关,真是太麻烦了。 经常要切换ip,所以我写了两个脚本:c:\办公室.

Windows下通过脚本快速修改IP地址

如果通过Windows的网络属性修改Ip/网关,真是太麻烦了。
经常要切换ip,所以我写了两个脚本:

c:\办公室.bat
netsh interface ip set address "以太网" static 192.168.1.234 255.255.255.0 192.168.1.1 1

c:\家里
netsh interface ip set address "以太网" static 172.16.1.220 255.255.255.0 172.16.1.254 1

这样就可以设置IP/Mask/GateWay了,netsh命令真方便!

添加多个DNS服务器方法:

netsh interface ip add dns name = "以太网" addr = 202.101.224.68
netsh interface ip add dns name = "以太网" addr = 202.101.224.69
netsh interface ip add dns name = "以太网" addr = 202.96.128.68
netsh interface ip add dns name = "以太网" addr = 202.96.128.86


清空DNS服务器的方法:

rem 清空DNS
netsh interface ip set dns name = "以太网" static addr = none 

使用dhcp自动分配ip的快捷netsh命令:

netsh interface ip set address name="以太网" source=dhcp


为一个网络连接设置二个或多个IP地址:

netsh interface ip set address name="以太网" source=static addr=192.168.1.23 mask=255.255.255.0 gateway=192.168.1.1
netsh interface ip add address name="以太网" addr=10.2.2.5 mask=255.255.255.0
netsh interface ip add address name="以太网" addr=192.168.5.33 mask=255.255.255.0


目录
相关文章
|
4月前
|
Ubuntu 网络协议 Linux
如何在无公网IP环境使用Windows远程桌面Ubuntu
如何在无公网IP环境使用Windows远程桌面Ubuntu
65 0
|
5月前
|
网络协议 安全 文件存储
Windows本地搭建WebDAV服务并使用内网穿透远程访问【无公网IP】
Windows本地搭建WebDAV服务并使用内网穿透远程访问【无公网IP】
|
3月前
|
安全 Linux 网络安全
【Windows】搭建Emby媒体库服务器,实现无公网IP远程访问
【Windows】搭建Emby媒体库服务器,实现无公网IP远程访问
244 0
|
3天前
|
关系型数据库 MySQL PHP
如何在Windows安装Wnmp服务并实现固定地址远程访问
如何在Windows安装Wnmp服务并实现固定地址远程访问
|
21天前
|
Windows
【Windows】 手写脚本更快编辑hosts文件
【Windows】 手写脚本更快编辑hosts文件
16 0
|
2月前
|
NoSQL 网络协议 MongoDB
Windows公网远程连接MongoDB数据库【无公网IP】
Windows公网远程连接MongoDB数据库【无公网IP】
|
5月前
|
存储 数据可视化 数据库
InfluxData【付诸实践 01】Windows环境部署Telegraf+Influxdb+Grafana安装及使用配置(含百度云盘资源+demo脚本)
InfluxData【付诸实践 01】Windows环境部署Telegraf+Influxdb+Grafana安装及使用配置(含百度云盘资源+demo脚本)
84 0
|
5月前
|
网络协议 安全 Linux
无公网IP环境Windows系统使用VNC远程连接Deepin桌面
无公网IP环境Windows系统使用VNC远程连接Deepin桌面
|
5月前
|
网络协议 NoSQL MongoDB
通过内网穿透实现在无公网IP下,Windows远程连接MongoDB数据库
通过内网穿透实现在无公网IP下,Windows远程连接MongoDB数据库
|
7月前
|
Ubuntu 网络协议 Linux
【无公网IP】在公网环境下Windows远程桌面Ubuntu 18.04
【无公网IP】在公网环境下Windows远程桌面Ubuntu 18.04

热门文章

最新文章