2025-09-08 12:55:20 +08:00
|
|
|
:log debug "用户 $"remote-address" 下线"
|
|
|
|
|
|
|
|
|
|
# 删除旧的分配规则
|
2025-09-08 15:00:47 +08:00
|
|
|
:local "snat-address" [/ip/firewall/nat/get [find comment~"snat $"remote-address""] to-addresses]
|
|
|
|
|
/ip/firewall/nat/remove [find comment~"snat $"remote-address""]
|
2025-09-08 12:55:20 +08:00
|
|
|
|
|
|
|
|
:log debug "删除旧的 nat 规则"
|
|
|
|
|
|
|
|
|
|
# 上报调度服务
|
|
|
|
|
:local edge ($"snat-address"&0.0.0.255<<8)
|
|
|
|
|
:local city (($"snat-address"&0.0.255.0>>8)+1)
|
|
|
|
|
:local localip (172.16.0.0|$edge|$city)
|
|
|
|
|
|
|
|
|
|
:log debug "上报到调度服务 http://192.168.250.250:18702/server/ros/down/ip/$localip"
|
|
|
|
|
/tool fetch url="http://192.168.250.250:18702/server/ros/down/ip/$localip" mode=http
|
|
|
|
|
/file remove "$localip"
|