双线路策略路由和脚本备份切换

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

双线路策略路由和脚本备份切换

  2021-03-17 我要评论
想了解双线路策略路由和脚本备份切换的相关内容吗,在本文为您仔细讲解的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:双线线路路策策略略路路由由和和脚脚本本备备份份切切换换,下面大家一起来学习吧。
电信和网通的双线路策略路由.并且在其中一条线路断掉后自动切换为单线路,线路恢复后,恢复使用策略路由.
电信网关 190.168.1.10
网通网关 192.168.1.9

1 先设置用电信线路上网.

2.添加网通独立的路由表.
CODE / ip policy-routing table test1
add dst-address=0.0.0.0/0 gateway=192.168.1.9 preferred-source=0.0.0.0 comment="" disabled=no
3 在rule里添加策略路由规则
CODE / ip policy-routing rule
add src-address=0.0.0.0/0 dst-address=59.80.0.0/14 flow="" interface=all action=lookup table=test1 \
   comment="" disabled=no
..
..
此处省略
记得把main移动到最后
4、配置自动切换脚本
CODE / system script
add name="test1down" source="/ ip policy-routing table test1
\nset \[/ ip policy-routing table test1 find \
   dst-address=0.0.0.0\] gateway 190.168.1.10
\n" policy=ftp,reboot,read,write,policy,test
add name="test1up" source="/ ip policy-routing table test1
\nset \[/ ip policy-routing table test1 find \
   dst-address=0.0.0.0\] gateway 192.168.1.9
\n" policy=ftp,reboot,read,write,policy,test
add name="maindown" source="/ ip policy-routing table main
\nset \[/ ip policy-routing table main find \
   dst-address=0.0.0.0\] gateway 192.168.1.9" policy=ftp,reboot,read,write,policy,test
add name="mainup" source="/ ip policy-routing table main
\nset \[/ ip policy-routing table main find \
   dst-address=0.0.0.0\] gateway 190.168.1.10" policy=ftp,reboot,read,write,policy,test

5 配置NETWATCH用于监视网络的通断情况
CODE / tool netwatch
add host=190.168.1.10 timeout=1s interval=20s up-script=mainup down-script=maindown comment="" disabled=no
add host=192.168.1.9 timeout=1s interval=20s up-script=test1up down-script=test1down comment="" disabled=no 文章录入:csh    责任编辑:csh 

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们