在实验室和寝室上网,要使用不同的ip,每次都改下太麻烦了,写了2个bat文件修改。

@ echo off
echo 设置422ip地址

set addr=10.214.25.81
set mask=255.255.255.0
set gway=10.214.25.1
set dns1=10.10.0.21
echo ------------------------------
echo ip=%addr%
echo mask=%mask%
echo gateway=%gway%
echo dns=%dns1%

netsh interface ip set address "本地连接" static addr=%addr% mask=%mask% gateway=%gway% 1
netsh interface ip set dns "本地连接" static 10.10.0.21

echo ip设置完成
pause>nul

 

@ echo off
echo 设置190ip地址

set addr=222.205.059.084
set mask=255.255.255.0
set gway=222.205.059.1
set dns1=10.10.0.21
echo ------------------------------
echo ip=%addr%
echo mask=%mask%
echo gateway=%gway%
echo dns=%dns1%

netsh interface ip set address "本地连接" static addr=%addr% mask=%mask% gateway=%gway% 1
netsh interface ip set dns "本地连接" static 10.10.0.21

echo ip设置完成
pause>nul

相关文章:

  • 2021-06-02
  • 2021-08-16
  • 2021-06-21
  • 2021-10-01
  • 2021-07-06
  • 2021-05-28
猜你喜欢
  • 2022-02-23
  • 2021-10-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2021-12-21
相关资源
相似解决方案