批处理设ip和dns
2011/11/1 8:17:48 itoracja http://itoracja.iteye.com
我要评论(0)
- 摘要:批处理设置ip和dns静态ip@echooffcolor0aecho*****************************************************************echo设置ip地址为公司路由模式echocopyright(c)2007-2008echo*****************************************************************echo
- 标签:
批处理设置ip和dns 静态ip
@echo off
color 0a
echo *****************************************************************
echo 设置ip地址为公司路由模式
echo copyright (c) 2007-2008
echo *****************************************************************
echo.
netsh interface ipv4 set address name="本地连接" source=static addr=192.168.1.2 mask=255.255.255.0 gateway=192.168.1.1 gwmetric=0
echo ip,子网掩码,网关设置完成
netsh interface ipv4 set dns name="本地连接" source=static addr=221.136.0.1 register=primary
echo dns1设置完成........
netsh interface ipv4 add dns name="本地连接" addr=192.168.0.253
echo dns2设置完成........
netsh interface ipv4 add dns name="本地连接" addr=203.175.200.202
echo dns2设置完成........
netsh interface ipv4 set wins name="本地连接" source=static addr=none
echo 设置ip地址为公司路由模式完成!
echo.
ipconfig /all
pause
close
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
@echo off
color 0a
echo.
echo *****************************************************************
echo 设置ip地址为家庭路由模式
echo copyright (c) 2007-2008
echo *****************************************************************
netsh interface ipv4 set address name="本地连接" source=static addr=192.168.1.3 mask=255.255.255.0 gateway=192.168.1.1 gwmetric=0
echo ip,子网掩码,网关设置完成
netsh interface ipv4 set dns name="本地连接" source=static addr=221.136.0.1 register=primary
echo dns1设置完成........
netsh interface ipv4 add dns name="本地连接" addr=192.168.1.1
echo dns2设置完成........
netsh interface ipv4 add dns name="本地连接" addr=203.175.200.202
echo dns2设置完成........
netsh interface ipv4 set wins name="本地连接" source=static addr=none
echo 设置ip地址为家庭路由模式完成!
echo.
ipconfig /all
pause
close