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