wujie19870103 发表于 2009-11-28 14:35:44

ROS三线负载,第一条线不工作,为什么?

我做了ROS三线NTH负载,试用过,第一次的时候用迅雷测试有效果,但用一会儿之后就不行了,现在只有两条线有效果,第一条没反应,我只用了一个用户测试,是拨号上网的,请问是不是有什么问题呢?下面是我用的脚本:

1.普通脚本设置
/ ip address
add address=A1IP interface=ADSL1 comment="1" disabled=no
add address=A2IP interface=ADSL2 comment="2" disabled=no
add address=A3IP interface=ADSL1 comment="3" disabled=no

/ ip route
add dst-address=0.0.0.0/0 gateway=A1网关 routing-mark=1 comment="1"
add dst-address=0.0.0.0/0 gateway=A2网关 routing-mark=2 comment="2"
add dst-address=0.0.0.0/0 gateway=A3网关 routing-mark=3 comment="3

2.添加NAT,NTH脚本(如果内网是拨号的,就把in-interface=Lan改为Src.Address=填你的IP-pool)
/ ip firewall mangle
add chain=prerouting in-interface=Lan protocol=tcp connection-state=new nth=2,1,0 action=mark-connection \
    new-connection-mark=1 passthrough=yes comment="A1 NTH" disabled=no
add chain=prerouting in-interface= Lan protocol=tcp connection-mark=1 action=mark-routing new-routing-mark=1 \
    passthrough=no comment="A1 NTH" disabled=no
add chain=prerouting in-interface= Lan protocol=tcp connection-state=new nth=2,1,1 action=mark-connection \
    new-connection-mark=2 passthrough=yes comment="A2 NTH" disabled=no
add chain=prerouting in-interface= Lan protocol=tcp connection-mark=2 action=mark-routing new-routing-mark=2 \
    passthrough=no comment="A2 NTH" disabled=no
add chain=prerouting in-interface= Lan protocol=tcp connection-state=new nth=2,1,2 action=mark-connection \
    new-connection-mark=3 passthrough=yes comment="A3 NTH" disabled=no
add chain=prerouting in-interface= Lan protocol=tcp connection-mark=3 action=mark-routing new-routing-mark=3 \
    passthrough=no comment="A3 NTH" disabled=no

3.添加NAT规则
/ ip firewall nat
add chain=srcnat connection-mark=1 action=src-nat to-addresses=A1IP to-ports=0-65535 comment="1" disabled=no
add chain=srcnat connection-mark=2 action=src-nat to-addresses=A2IP to-ports=0-65535 comment="2" disabled=no
add chain=srcnat connection-mark=3 action=src-nat to-addresses=A3IP to-ports=0-65535 comment="3" disabled=no

4.同步NAT,ADSL动态IP,网关脚本(30S运行一次)
:local assign-address
:local new-address
:local status
:local x
:set x 3
:for i from=1 to=$x do={
    :set status running]
    :if ($status=true) do={
   :set new-address address]
   :set new-address [:pick $new-address 0 ([:len $new-address] -3)]
   :set assign-address address]
   :set assign-address [:pick $assign-address 0 ([:len $assign-address] -3)]
:set new-gateway network]
:set adckip host]
      :if ($assign-address != $new-address) do={ /ip address set address=$new-address network=$new-address broadcast=$new-address
      /ip route set gateway=$new-gateway]
      /ip firewall nat set to-addresses=$new-address
      /ip route set gateway=$new-gateway]
       }
    :if ($new-gateway != $adckip) do={/tool netwatch set host=$new-gateway]
}
   }
}
页: [1]
查看完整版本: ROS三线负载,第一条线不工作,为什么?