标准3线PCC

/ip firewall mangle
add action=mark-connection chain=input comment=From_ADSL1 dst-address-type="" in-interface=pppoe-out1 new-connection-mark=adsl1_conn passthrough=yes src-address-type=""
add action=mark-routing chain=output comment=To_ADSL1 connection-mark=adsl1_conn new-routing-mark=to_adsl1 passthrough=yes
add action=mark-connection chain=prerouting comment=pcc_1 connection-state=new dst-address-type=!local new-connection-mark=adsl1_conn passthrough=yes \
    per-connection-classifier=both-addresses:3/0 src-address-list=lan
add action=mark-routing chain=prerouting connection-mark=adsl1_conn new-routing-mark=to_adsl1 passthrough=yes src-address-list=lan
add action=mark-connection chain=input comment=From_ADSL2 in-interface=pppoe-out2 new-connection-mark=adsl2_conn passthrough=yes
add action=mark-routing chain=output comment=To_ADSL2 connection-mark=adsl2_conn new-routing-mark=to_adsl2 passthrough=yes
add action=mark-connection chain=prerouting comment=pcc_2 connection-state=new dst-address-type=!local new-connection-mark=adsl2_conn passthrough=yes \
    per-connection-classifier=both-addresses:3/1 src-address-list=lan
add action=mark-routing chain=prerouting connection-mark=adsl2_conn new-routing-mark=to_adsl2 passthrough=yes src-address-list=lan
add action=mark-connection chain=input comment=From_ADSL3 in-interface=pppoe-out3 new-connection-mark=adsl3_conn passthrough=yes
add action=mark-routing chain=output comment=To_ADSL3 connection-mark=adsl3_conn new-routing-mark=to_adsl3 passthrough=yes
add action=mark-connection chain=prerouting comment=pcc_3 connection-state=new dst-address-type=!local new-connection-mark=adsl3_conn passthrough=yes \
    per-connection-classifier=both-addresses:3/2 src-address-list=lan
add action=mark-routing chain=prerouting connection-mark=adsl3_conn new-routing-mark=to_adsl3 passthrough=yes src-address-list=lan
========脚本=============

{
:local status
:local i "22"
:local x "0"
:local y "0"
:local z "0"
:set x [:len [/interface pppoe-client find running=yes]]
:if ($x<$i) do={
:for ii from=1 to=$i do={
:set status [/interface get [find name=("yd-out".$ii)] running]
:if ($status=true) do={
/ip firewall mangle set [find new-connection-mark="$ii-conn"] per-connection-classifier=("both-addresses-and-ports:".$x."/".$y) disable=no;:set y ($y+1)} else={
/ip firewall mangle set [find new-connection-mark="$ii-conn"] disable=yes}}}
:if ($x=$i) do={
:set z [:len [/ip firewall mangle find action="mark-connection" disabled=yes chain=prerouting]]
:if ($z>0) do={
:for ii from=1 to=$i do={
/ip firewall mangle set [find new-connection-mark="$ii-conn"] per-connection-classifier=("both-addresses-and-ports:".$x."/".$y) disable=no;:set y ($y+1)}}}}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值