手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

通过批处理快速设置IP、子网掩码、网关以及DNS

时间:2024-10-14 11:34:07

1、首先了解设置ip、dns命令行的用法:设置静态ip地址、子网掩码、默认网关格式:netsh interface ip set ad颊俄岿髭dress "网络名" static ip地址 子网掩码 默认网关设置静态dns格式:netsh interface ip set dns "网络名" static dns服务器地址 primary添加辅助dns格式:netsh interface ip add dns "网络名" dns服务器地址

2、新建文本文档,并打开。

通过批处理快速设置IP、子网掩码、网关以及DNS

3、此处以设置网络名为“本地连接”、ip为192.168.1.100、子网掩码为255.255.255.0、网关为192.168.1.1、主dns为114.114.114.114、辅dns为8.8.8.8为例。根据netsh命令行的用法可以如此设置:netsh interface ip set address "本地连接" static 192.168.1.100 255.255.255.0 192.168.1.1netsh interface ip set dns "本地连接" static 114.114.114.114 primarynetsh interface ip add dns "本地连接" 8.8.8.8

通过批处理快速设置IP、子网掩码、网关以及DNS

4、将以上命令行写在记事本里,保存为名为“设置ip&dns”,后缀名为“bat”的文件。

通过批处理快速设置IP、子网掩码、网关以及DNS

5、双击“设置ip&dns.bat”,系统就会执行命令,自动改好了ip和dns。

通过批处理快速设置IP、子网掩码、网关以及DNS
通过批处理快速设置IP、子网掩码、网关以及DNS

6、如果想删除ip和dns应该怎么办呢?删除ip和dns也就是设置动态ip和dns,它的命令行为:netsh interface ip set address name="网络名" source=dhcpnetsh interface ip set dns name="网络名" source=dhcp

7、假如想要为网络“本地连接”设置动态的ip和dns,可以这样写:netsh interface ip set address name="本地连接" source=dhcpnetsh interface ip set dns name="本地连接" source=dhcp

通过批处理快速设置IP、子网掩码、网关以及DNS

8、同理,保存为“设置动态ip&dns.bat”文件,单击运行系统就自动改成了动态的ip和dns。

通过批处理快速设置IP、子网掩码、网关以及DNS
通过批处理快速设置IP、子网掩码、网关以及DNS
© 手抄报圈