f-90: nft: chaînes hostsvc et md-<vm> dans la table ip two #90
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
dae1d0a935
commit
4f7d55a9ed
5 changed files with 274 additions and 1 deletions
|
|
@ -23,9 +23,13 @@ var natChains = []natChain{
|
|||
{"in-", "filter", "input", "filter"},
|
||||
}
|
||||
|
||||
func (c natChain) header() string {
|
||||
return fmt.Sprintf("type %s hook %s priority %s; policy accept;", c.kind, c.hook, c.priority)
|
||||
}
|
||||
|
||||
func (c natChain) declare(b *strings.Builder, iface string) string {
|
||||
name := c.prefix + iface
|
||||
fmt.Fprintf(b, "add chain ip %s %s { type %s hook %s priority %s; policy accept; }\n", Table, name, c.kind, c.hook, c.priority)
|
||||
fmt.Fprintf(b, "add chain ip %s %s { %s }\n", Table, name, c.header())
|
||||
fmt.Fprintf(b, "flush chain ip %s %s\n", Table, name)
|
||||
return name
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue