Skip to content

Commit

Permalink
fix(firewall): 删除复杂转发规则时报错
Browse files Browse the repository at this point in the history
  • Loading branch information
endymx committed Feb 1, 2025
1 parent 4be9d71 commit 6e71128
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/utils/firewall/client/iptables.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,9 @@ func (iptables *Iptables) NatRemove(num string, protocol, srcPort, dest, destPor
// 删除公网转发规则
if dest != "" && dest != "127.0.0.1" && dest != "localhost" {
if err := iptables.runf(NatTab, fmt.Sprintf(
"-D %s -p %s --dport %s -j DNAT MASQUERADE",
"-D %s -p %s -d %s --dport %s -j MASQUERADE",
PostRoutingChain,
dest,
protocol,
destPort,
)); err != nil {
Expand Down

0 comments on commit 6e71128

Please sign in to comment.