windows下使用脚本修改网络配置

发布时间:2020-07-23 15:55:08 作者:Mkyang
来源:网络 阅读:555

@echo off
set /p input=输入
set hostip=%input%
netsh interface ip set address "WLAN" static 192.168.2.%hostip% 255.255.255.0 192.168.2.1 1
netsh interface ip set dns "WLAN" static 202.96.128.86 primary
netsh interface ip add dns "WLAN" 202.96.128.86

说明

set /p input=输入
输入一个主机位的ip

set hostip=%input%
变量hostip赋值,引用input

netsh interface ip set address "WLAN" static 192.168.2.%hostip% 255.255.255.0 192.168.2.1 1
设置ip地址、子网掩码、网关、跳跃数
"WLAN” 网卡名称
%hostip% 引用变量

netsh interface ip set dns "WLAN" static 202.96.128.86 primary
设置主dns

netsh interface ip add dns "WLAN" 202.96.128.86
增加备用dns

推荐阅读:
  1. Windows下bat脚本
  2. Windows下通过脚本自动发邮件

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

网络配置 ip dns

上一篇:SpringBoot如何配置lombok与logback

下一篇:oracle dg 主、备切换SWITCHOVER 全过程记录

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》