Skip to content

Commit

Permalink
fix(firewall): docker external ports issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sniirful committed May 20, 2024
1 parent c950de3 commit 52377b4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion firewall/firewall/rules/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ func getIPTablesCommand(config configuration.Configuration, service services.Ser
}
}()), service.Chain,
"-p", service.Protocol,
"--dport", fmt.Sprintf("%v", service.Port),
// taken from:
// https://docs.docker.com/network/packet-filtering-firewalls/#match-the-original-ip-and-ports-for-requests
"-m", "conntrack",
"--ctorigdstport", fmt.Sprintf("%v", service.Port),
"-j", "NFQUEUE",
"--queue-num", fmt.Sprintf("%v", service.Nfq),
)
Expand Down

0 comments on commit 52377b4

Please sign in to comment.