首页服务器Web服务器 阿里云添加路由的Windows批处理文件

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

发现一段很好的学习bat程序的示例代码,分享给大家,具体代码如下: @echo offroute print -4 "10.0.0.0" | find "10.0.0.0" > route_listset gw=for /F "tokens=1-5" %%a in ('…

发现一段很好的学习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
本文来自网络,不代表1号站长-站长学院|资讯交流平台立场。转载请注明出处: https://www.1cn.cc/fwq/web/5286.html
上一篇virtualbox不能安装64位系统的解决方法
下一篇 CentOS7按时间段截取指定的Tomcat日志到指定文件的方法
admin

作者: admin

这里可以再内容模板定义一些文字和说明,也可以调用对应作者的简介!或者做一些网站的描述之类的文字或者HTML!

为您推荐

评论列表()

    联系我们

    联系我们

    0898-88888888

    在线咨询: QQ交谈

    邮箱: email@wangzhan.com

    工作时间:周一至周五,9:00-17:30,节假日休息

    关注微信
    微信扫一扫关注我们

    微信扫一扫关注我们

    关注微博
    返回顶部