WGHBOY 发表于 2009-4-1 20:48:58

ros3.22 adsl 5线nth负载均衡,自动限速试用成功,上图,有脚本

# mar/30/2009 12:05:33 by RouterOS 3.22
# software id = AK73-PET
#
/queue type
add kind=pcq name=user2 pcq-classifier=dst-address pcq-limit=50 pcq-rate=\
    1500000 pcq-total-limit=2000
add kind=pcq name=user1 pcq-classifier=dst-address pcq-limit=50 pcq-rate=\
    1500000 pcq-total-limit=2000
   
/ip firewall mangle
add action=mark-connection chain=prerouting comment="" connection-state=new \
    disabled=no new-connection-mark=nth_1 nth=2,1 passthrough=yes \
    src-address=192.168.10.0/24
add action=mark-routing chain=prerouting comment="" connection-mark=nth_1 \
    disabled=no new-routing-mark=routing_1 passthrough=no src-address=\
    192.168.10.0/24
add action=mark-connection chain=prerouting comment="" connection-state=new \
    disabled=no new-connection-mark=nth_2 passthrough=yes \
    src-address=192.168.10.0/24
add action=mark-routing chain=prerouting comment="" connection-mark=nth_2 \
    disabled=no new-routing-mark=routing_2 passthrough=no src-address=\
    192.168.10.0/24

/ip firewall nat
add action=masquerade chain=srcnat comment="" connection-mark=nth_1 disabled=\
    no out-interface=pppoe-out1
add action=masquerade chain=srcnat comment="" connection-mark=nth_2 disabled=\
    no out-interface=pppoe-out2
add action=masquerade chain=srcnat comment="" disabled=no

/ip route
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
    pppoe-out2 routing-mark=routing_2
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
    pppoe-out1 routing-mark=routing_1

/system scheduler
add comment="" disabled=no interval=10s name=auto_queue on-event=":global RxCu\
    rRate 0\r\
    \n:global RxCurMaxa 6000000\r\
    \n:global RxCurMaxb 8000000\r\
    \n:global RxCurMaxc 10000000\r\
    \n:global RxCurMaxd 6000000\r\
    \n:global RxCurSet 0\r\
    \n:global RxCurSeta 800000\r\
    \n:global RxCurSetb 600000\r\
    \n:global RxCurSetc 500000\r\
    \n:global RxCurSetd 1500000\r\
    \n\r\
    \n/interface monitor lan once do={:set RxCurRate \$\"sent-bits-per-second\
    \"}\r\
    \n:set RxCurSet pcq-rat\
    e]\r\
    \n\r\
    \n:if (\$RxCurMaxa<\$RxCurRate) do={:if (\$RxCurMaxb>\$RxCurRate) do={:if \
    (\$RxCurSet != \$RxCurSeta) do={\r\
    \n/queue type set \"user1\" pcq-rate=800000\r\
    \n/queue type set \"user2\" pcq-rate=800000}}}\r\
    \n:if (\$RxCurMaxb<\$RxCurRate) do={:if (\$RxCurMaxc>\$RxCurRate) do={:if \
    (\$RxCurSet != \$RxCurSetb) do={\r\
    \n/queue type set \"user1\" pcq-rate=600000\r\
    \n/queue type set \"user2\" pcq-rate=500000}}}\r\
    \n:if (\$RxCurMaxc<\$RxCurRate) do={:if (\$RxCurSet != \$RxCurSetc) do={\r\
    \n/queue type set \"user1\" pcq-rate=500000\r\
    \n/queue type set \"user2\" pcq-rate=400000}}\r\
    \n:if (\$RxCurMaxd>\$RxCurRate) do={:if (\$RxCurSet != \$RxCurSetd) do={\r\
    \n/queue type set \"user1\" pcq-rate=1500000\r\
    \n/queue type set \"user2\" pcq-rate=1500000}}\r\
    \n\r\
    \n" start-date=jan/01/1970 start-time=00:00:00

pxyq 发表于 2009-4-1 20:59:27

坐沙发了,支持原创

winepo 发表于 2009-4-1 22:31:42

板凳也可以

samboy 发表于 2009-4-1 23:41:49

上面好似2线吧 都8完整把脚本放出 还叫5线

WGHBOY 发表于 2009-4-2 00:25:47

兄弟,你不是也5线吧,这个只做参考,不是你搬过去就能用了,教你学1+1等于几,还用不用教你1+2等于几呀,那样老师一辈子也教不完你

samboy 发表于 2009-4-2 00:34:53

我知道!但是老妈叫我做人要厚道.
放了一一点脚本 和图有出入 8厚道

samboy 发表于 2009-4-2 00:41:46

小学生 老师叫了1+1=几 至于1+2=几老师都有教中国人和外国人就有差别 国人老是留一手 说啥教了徒弟饿死师父 根本就是心理作用 老外就8会这样想
哈哈 我只是1线 抱着学习的态度来噶 玩VM玩玩都好

WGHBOY 发表于 2009-4-2 00:50:12

:lol你1线叫我发个5线干吗,两线你都用不上;P

tmd 发表于 2009-4-2 02:51:20

WGHBOY
能不能给份脚本给我呀

WGHBOY 发表于 2009-4-2 04:58:29

脚本就在上面,2线的,有几根就改几根

samboy 发表于 2009-4-2 07:42:40

:lol;P哈哈

dboy2004 发表于 2009-4-2 08:31:28

有请问ADSL接入的脚本吗?

WGHBOY 发表于 2009-4-2 18:51:15

:dizzy:接入还要脚本

WGHBOY 发表于 2009-4-2 18:52:59

/ interface pppoe-client
add name="pppoe-out1" max-mtu=1480 max-mru=1480 interface=2wan \
    user="帐号" password="密码" profile=default \
    service-name="" ac-name="" add-default-route=yes dial-on-demand=no \
    use-peer-dns=no allow=pap,chap,mschap1,mschap2 disabled=no
add name="pppoe-out2" max-mtu=1480 max-mru=1480 interface=5wan \
    user="帐号" password="密码" profile=default \
    service-name="" ac-name="" add-default-route=yes dial-on-demand=no \
    use-peer-dns=no allow=pap,chap,mschap1,mschap2 disabled=no

samboy 发表于 2009-4-3 02:36:59

放嘚太小喇 放多点啊
页: [1] 2 3
查看完整版本: ros3.22 adsl 5线nth负载均衡,自动限速试用成功,上图,有脚本