Portmap: append, rather than prepend, entry rules

This means that portmapped connections can be more easily controlled /
firewalled.
This commit is contained in:
Casey Callendrello
2019-02-26 11:43:35 +01:00
committed by Dan Williams
parent afd7391938
commit 9fab520c37
5 changed files with 27 additions and 9 deletions

View File

@ -255,6 +255,10 @@ func genMarkMasqChain(markBit int) chain {
table: "nat",
name: MarkMasqChainName,
entryChains: []string{"POSTROUTING"},
// Only this entry chain needs to be prepended, because otherwise it is
// stomped on by the masquerading rules created by the CNI ptp and bridge
// plugins.
prependEntry: true,
entryRules: [][]string{{
"-m", "comment",
"--comment", "CNI portfwd requiring masquerade",