首页 > 服务器 > Win服务器 > 正文

阿里云添加路由的Windows批处理文件

2020-07-28 15:51:59
字体:
来源:转载
供稿:网友
今天小编发现一段很好的学习bat程序的示例代码,特此分享到错新网之家平台,供大家参考

发现一段很好的学习bat程序的示例代码,分享给大家,具体代码如下:

@echo offroute print -4 "10.0.0.0" | find "10.0.0.0" > route_listset gw=for /F "tokens=1-5" %%a in ('type route_list') do ( if not "%%c" == "" ( set gw=%%c ))if "%gw%" == "" ( echo "fail to get eth0 default gw" && goto error)route print -4 100.64.0.0 | find "%gw%" > NULif not "%errorlevel%" == "0" (  route -p add 100.64.0.0 mask 255.192.0.0 %gw% > NUL 2>&1)if not "%errorlevel%" == "0" ( echo "faild to add route 100.64.0.0/10" && goto error):successdel route_listecho "add 100.64.0.0/10 success !"timeout 10exit 0:errortimeout 10exit 1

以上所述是小编给大家介绍的阿里云添加路由的Windows批处理文件,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对错新网之家网站的支持!

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表