找回密码
 注册

QQ登录

只需一步,快速开始

搜索
楼主: jackey56

[策略设置] ROS动态ADSL+固定IP做策略路由

  [复制链接]
发表于 2005-11-10 14:19:22 | 显示全部楼层
请问大哥?
自动切换脚本又应该如何写呢?
看过大哥的动态网关的贴子,受益非浅,真的好谢谢您
可我却没有发现有人跟我一样的情况做策略路由的(一条网通光纤,一条固定网关的ADSL)
由于俺接触路由,所以不是很懂,
所以还是麻烦帮我一下,能跟我说一下自动切换脚本吗?
routeros
回复

使用道具 举报

 楼主| 发表于 2005-11-10 21:52:02 | 显示全部楼层
原帖由 heikidik 于 2005-11-10 14:19 发表
请问大哥?
自动切换脚本又应该如何写呢?
看过大哥的动态网关的贴子,受益非浅,真的好谢谢您
可我却没有发现有人跟我一样的情况做策略路由的(一条网通光纤,一条固定网关的ADSL)
由于俺接触路由,所以不是 ...


固定网关ADSL+固定IP做策略可以参考王珏清的"routeros电信+网通双线策略过程"的贴子,原理是一样的.
routeros
回复

使用道具 举报

发表于 2005-11-11 08:36:29 | 显示全部楼层
谢谢大哥,你实在是太伟大了
我对你的敬仰.........如有长江之水,滔滔不绝、连绵不断.......
祝你工作顺利、万事如意!好人一生平安!
routeros
回复

使用道具 举报

发表于 2005-11-13 13:28:55 | 显示全部楼层

不错

不错不错不错
routeros
回复

使用道具 举报

发表于 2005-11-15 10:40:21 | 显示全部楼层
学习中~现在最想学的就是这方面的咯
routeros
回复

使用道具 举报

 楼主| 发表于 2005-11-16 20:46:02 | 显示全部楼层
优化过的脚本代码,去除了变量,直接获取ADSL的网关IP!
按前面的教程,五个脚本直接使用下面的代码就行了,没有前面讲的BUG了。



注意:把脚本中的111.111.111.111改为自己的电信网关

-------------------------------------------------------adslwatch

/interface pppoe-client monitor pppoe-out1 once do={
  :if ($status="connected") do={
    /ip policy-routing table cncnetwatch
    set [/ip policy-routing table cncnetwatch find dst-address=0.0.0.0] gateway [/ip address get [/ip address find interface=pppoe-out1] network]
    /ip policy-routing rule
    set [/ip policy-routing rule find table=cncnetwatch] dst-address [/ip address get [/ip address find interface=pppoe-out] network] dst-netmask 255.255.255.255
    /tool netwatch set adsl host [/ip address get [/ip address find interface=pppoe-out1] network]
  }
}



---------------------------------------------------------adslup

/ip policy-routing table cnc
set [/ip policy-routing table cnc find dst-address=0.0.0.0] gateway [/ip address get [/ip address find interface=pppoe-out1] network]
:if ([/tool netwatch get ip status]="down") do={
  /ip policy-routing table main
  set [/ip policy-routing table main find dst-address=0.0.0.0] gateway [/ip address get [/ip address find interface=pppoe-out1] network]
}
/system scheduler disable [/system scheduler find name=schedule1]
/system scheduler disable [/system scheduler find name=schedule2]





---------------------------------------------------------adsldown

/ip policy-routing table cnc
set [/ip policy-routing table cnc find dst-address=0.0.0.0] gateway 111.111.111.111
/system scheduler enable [/system scheduler find name=schedule1]
:if ([/system resource get uptime]

优化的双线脚本.rar

749 Bytes, 下载次数: 183

优化的双线脚本

routeros
回复

使用道具 举报

发表于 2005-11-17 10:31:22 | 显示全部楼层
谢谢楼主大哥,你的大恩大德,永世难忘~~
routeros
回复

使用道具 举报

发表于 2005-11-17 23:26:49 | 显示全部楼层
知道什么叫顶吗?就是用力的向上顶
routeros
回复

使用道具 举报

发表于 2005-11-19 02:00:16 | 显示全部楼层
这样的文章实在太好了。一定要用力顶~
routeros
回复

使用道具 举报

发表于 2005-11-19 03:58:03 | 显示全部楼层

顶!

顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!顶!
routeros
回复

使用道具 举报

发表于 2005-11-19 22:42:34 | 显示全部楼层
含泪接下,偶就需要这个呀!!!太谢谢了!!!
routeros
回复

使用道具 举报

发表于 2005-11-19 22:44:02 | 显示全部楼层
唉,顶你的偶觉得有点少啊,偶就再顶一次了!
routeros
回复

使用道具 举报

发表于 2005-11-20 06:05:42 | 显示全部楼层
非常好的一个介绍  
     在这里先谢谢了啊
routeros
回复

使用道具 举报

发表于 2005-11-21 06:42:56 | 显示全部楼层
顶哈,呵呵
希望续继发表
routeros
回复

使用道具 举报

发表于 2005-11-21 07:42:20 | 显示全部楼层
高手就是不一样.
routeros
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-12-27 13:05 , Processed in 0.142341 second(s), 16 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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