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

 找回密码
 会员注册

QQ登录

只需一步,快速开始

查看: 1141|回复: 0

[求助] 求修改一脚本

[复制链接]
发表于 2015-7-1 22:15:40 | 显示全部楼层 |阅读模式

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

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

x
/ip firewall mangle
add action=jump chain=prerouting comment=adsl_bonding disabled=no dst-port=80,81,82,8080 jump-target=bonding protocol=tcp src-address=192.168.0.0/16
add action=jump chain=prerouting comment="" disabled=no jump-target=bonding src-address-list=other_list
add action=mark-connection chain=bonding comment="" disabled=no dst-address-type=!local in-interface=LAN new-connection-mark=adsl1conn passthrough=yes per-connection-classifier=both-addresses:3/0
add action=mark-routing chain=bonding comment="" connection-mark=adsl1conn disabled=no in-interface=LAN new-routing-mark=main passthrough=yes
add action=mark-connection chain=bonding comment="" disabled=no dst-address-type=!local in-interface=LAN new-connection-mark=adsl2conn passthrough=yes per-connection-classifier=both-addresses:3/1
add action=mark-routing chain=bonding comment="" connection-mark=adsl2conn disabled=no in-interface=LAN new-routing-mark=main passthrough=yes
add action=mark-connection chain=bonding comment="" disabled=no dst-address-type=!local in-interface=LAN new-connection-mark=adsl3conn passthrough=yes per-connection-classifier=both-addresses:3/2
add action=mark-routing chain=bonding comment="" connection-mark=adsl3conn disabled=no in-interface=LAN new-routing-mark=main passthrough=yes

/ip firewall nat
add action=src-nat chain=srcnat comment=ADSL1 connection-mark=adsl1conn disabled=yes src-address=192.168.0.0/16 to-addresses=121.69.45.22
add action=src-nat chain=srcnat comment=ADSL2 connection-mark=adsl2conn disabled=yes src-address=192.168.0.0/16 to-addresses=121.71.114.11
add action=src-nat chain=srcnat comment=ADSL3 connection-mark=adsl3conn disabled=yes src-address=192.168.0.0/16 to-addresses=121.69.47.21
add action=src-nat chain=srcnat comment="" disabled=yes src-address=192.168.0.0/16 to-addresses=221.219.144.111


:local curaddress
:local newaddress
:local status
:local x
:set x 3
:for i from=1 to=$x do={
:set status [/interface get [/interface find name=("pppoe-out" . $i)] running]
:if ($status=true) do={
:set newaddress [/ip address get [/ip address find dynamic=yes interface=("pppoe-out" . $i)] address ]
:set newaddress [:pick $newaddress 0 [:find $newaddress "/"]]
:set curaddress [ /ip firewall nat get [/ip firewall nat find comment=("ADSL" . $i)] to-addresses ]
:if ($curaddress != $newaddress) do={
/ip firewall nat set [ /ip firewall nat find comment=("ADSL" . $i) ] to-addresses=$newaddress
:log info ("Change ADSL" . $i . " NAT IP" )
}
}
}

看的出来这个是3线的,然后,我就2个线,一个ADSL一个固定光钎,求怎么修改。
您需要登录后才可以回帖 登录 | 会员注册

本版积分规则

不良信息举报Q:2000617

软路由

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

GMT+8, 2024-5-4 18:12 , Processed in 0.166754 second(s), 21 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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