19 lines
631 B
Plaintext
19 lines
631 B
Plaintext
|
|
:local num [/system script get num source]
|
||
|
|
:local count [:len [/interface l2tp-client find ]]
|
||
|
|
:local pnum 0
|
||
|
|
|
||
|
|
:set pnum ($num+1)
|
||
|
|
/system script set num source="$pnum"
|
||
|
|
|
||
|
|
:if ($num>$count) do={
|
||
|
|
:set num 1
|
||
|
|
/system script set num source="1"
|
||
|
|
}
|
||
|
|
|
||
|
|
/ip firewall mangle add action=mark-routing chain=prerouting new-routing-mark="r$num" src-address=$"remote-address"
|
||
|
|
|
||
|
|
:local localips [/ip address get [/ip address find interface="l2tp-out$num"] address ]
|
||
|
|
:local localip [:pick $"localips" begin=0 end=([:find $"localips" "/"])]
|
||
|
|
|
||
|
|
/tool fetch url="http://192.168.250.250:18702/server/ros/up/ip/$localip" mode=http
|
||
|
|
/file remove "$localip"
|