windows中netsh的使用 route的使用

设置为DHCP

netsh interface ipv4 set address name="office" source=dhcp

netsh interface ipv4 set dns name="office" source=dhcp

设置为STATIC

netsh interface ipv4 set address "office" source=static addr=192.168.4.249 mask=255.255.255.0
netsh interface ipv4 set dns "office" source=static addr=172.28.0.2

 

自动关机

@echo off
 
::at 20:35 /every:M,T,W,Th,F,S,Su shutdown -s -t 60 -c "Too late,it's time to get off work!"
at 20:45 /every:M,T,W,Th,F,S,Su shutdown -s -f
echo Done!
 
pause&end

route添加与删除

route delete -p 0.0.0.0 mask 0.0.0.0 192.168.4.250

route add -p 192.168.0.246 mask 255.255.255.255 192.168.4.250 if 10

netsh interface ipv4 add address "test" 192.168.3.168 255.255.255.0

route add -p 192.168.1.1 mask 255.255.255.255 192.168.0.234 if 12

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值