修复上下线脚本 snat 查找逻辑

This commit is contained in:
2025-09-08 15:00:47 +08:00
parent 906ef41e50
commit 923b338172
2 changed files with 3 additions and 3 deletions

View File

@@ -1,8 +1,8 @@
:log debug "用户 $"remote-address" 下线"
# 删除旧的分配规则
:local "snat-address" [/ip/firewall/nat/get [find src-address $"remote-address"] to-addresses]
/ip/firewall/nat/remove [find where src-address $"remote-address"]
:local "snat-address" [/ip/firewall/nat/get [find comment~"snat $"remote-address""] to-addresses]
/ip/firewall/nat/remove [find comment~"snat $"remote-address""]
:log debug "删除旧的 nat 规则"

View File

@@ -1,7 +1,7 @@
:log debug "用户 $"remote-address" 上线"
# 删除旧的分配规则
/ip/firewall/nat/remove [find where src-address $"remote-address"]
/ip/firewall/nat/remove [find comment~"snat $"remote-address""]
:log debug "删除旧的 nat 规则"