ROS软路由论坛 ROSABC.com 网络方案网络工程交流

 找回密码
 会员注册

QQ登录

只需一步,快速开始

查看: 16366|回复: 11

[交流] ROS软路由多条外网线路,采用脚本自动化检测最优外网线路

[复制链接]
发表于 2008-12-3 01:12:06 | 显示全部楼层 |阅读模式

马上注册成为ROSABC会员,随时发帖回复。

您需要 登录 才可以下载或查看,没有账号?会员注册

x
实现“ROS软路由多条外网线路,采用脚本自动化检测最优外网线路”,分两部分:
1.脚本实现对外网线路最优判断
2.脚本实现线路选择的切换


下面是脚本实现线路自动化选择切换

  • :global status118
  • :global status210
  • :global status101
  • :global s210
  • :global s118
  • :global s101
  • :local num118
  • :local num210
  • :local num101
  • :local num1
  • :local num2
  • :local e 1;
  • :set status118 [/inte**ce get [/inte**ce find name="pptp_out_118" ] running]
  • :set status101 [/inte**ce get [/inte**ce find name="pptp_out_101" ] running]
  • :set status210 [/inte**ce get [/inte**ce find name="pptp_out_210" ] running]
  • :set s210 [/inte**ce get [/inte**ce find name="pptp_out_210" ] disable]
  • :set s118 [/inte**ce get [/inte**ce find name="pptp_out_118" ] disable]
  • :set s101 [/inte**ce get [/inte**ce find name="pptp_out_101" ] disable]
  • :if ($status118=false && $s118=false) do={
  • /inte**ce disable pptp_out_118
  • /inte**ce enable pptp_out_210
  • :set num1 ($e+1);
  • } else={
  • :if ($status118=true && $status210=false && $status101=false) do={
  • :log info "There is 118 lines!"
  • }
  • }
  • :if ($status210=false && $s210=false) do={
  • /inte**ce disable pptp_out_210
  • /inte**ce enable pptp_out_118
  • :set num2 ($e+1);
  • } else={
  • :if ($status210=true && $status118=false && $status101=false) do={
  • :log info "There is 210 lines!"
  • }
  • }
  • :if ($num1=2 && $num2=2) do={
  • /inte**ce enable pptp_out_101
  • /inte**ce disable pptp_out_210
  • /inte**ce disable pptp_out_118
  • :delay 5
  • :if ($status101=false && $s101=false) do={
  • /inte**ce disable pptp_out_101
  • /inte**ce enable pptp_out_118
  • } else={
  • :if ($status101=true && $status210=false && $status118=false) do={
  • :log info "There is 101 lines!"
  • }
  • }}

复制代码
另外脚本实现对外网线路最优判断
发表于 2008-12-6 22:53:32 | 显示全部楼层
成功了???
发表于 2008-12-8 09:09:20 | 显示全部楼层
谢谢谢快写快写
发表于 2008-12-9 00:03:49 | 显示全部楼层
ROS多条外网线路,采用脚本自动化检测最优外网线路 [
发表于 2008-12-10 05:57:13 | 显示全部楼层
学习了!等结果
发表于 2008-12-10 12:24:10 | 显示全部楼层
jackey 发表于 2012-9-15 12:38

                               
登录/注册后可看大图

成功了???


还没有,在做脚本自动化检测最优外网线路,处理如何获取流量值进行选取对比
发表于 2008-12-11 05:03:32 | 显示全部楼层
看不懂,是ping值检查?
发表于 2008-12-11 20:49:00 | 显示全部楼层
看看学习下
发表于 2008-12-11 21:02:54 | 显示全部楼层
csboy 发表于 2012-9-26 14:45

                               
登录/注册后可看大图

看不懂,是ping值检查?


PING值我想应该可取,因为之前想获取带宽值都失败了
(    /inte**ce monitor-traffic $i once do={
      :set tx ($sent-bits-per-second)
      :set rx ($received-bits-per-second))
发表于 2008-12-12 00:29:52 | 显示全部楼层
这个如果能用,还是很不错的!
您需要登录后才可以回帖 登录 | 会员注册

本版积分规则

不良信息举报Q:2000617

软路由

不良信息举报Q:2000617|Archiver|ROS软路由论坛 ROSABC.com 网络方案网络工程交流

GMT+8, 2025-6-16 20:39 , Processed in 0.838599 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表