rework rules

This commit is contained in:
Samuel Lorch 2023-03-01 18:20:47 +01:00
parent 02da0168f3
commit b09875fd85
9 changed files with 115 additions and 32 deletions

View file

@ -1,3 +1,2 @@
{{range $rule := .Netfilter.DestinationNATRules}}
{{template "rule_match.tmpl" .Match}} {{ if $rule.Counter }} counter {{ end }} {{ if ne $rule.Comment "" }} comment "{{ $rule.Comment }}" {{ end }}
{{end}}
{{ range $rule := .Netfilter.DestinationNATRules }}
{{ .Match.Nftables }}{{ if $rule.Counter }} counter{{ end }}{{ if ne $rule.Comment "" }} comment "{{ $rule.Comment }}"{{ end }}{{ end }}

View file

@ -1,3 +1,2 @@
{{range $rule := .Netfilter.ForwardRules}}
{{template "rule_match.tmpl" .Match}} {{ if $rule.Counter }} counter {{ end }} {{ if ne $rule.Comment "" }} comment "{{ $rule.Comment }}" {{ end }}
{{end}}
{{ .Match.Nftables }}{{ if $rule.Counter }} counter{{ end }} {{ $rule.Verdict.String }}{{ if ne $rule.Comment "" }} comment "{{ $rule.Comment }}"{{ end }}{{ end }}

View file

@ -1 +0,0 @@
tcp dport {{ .TCPDestinationPort }}

View file

@ -1,3 +1,2 @@
{{range $rule := .Netfilter.SourceNATRules}}
{{template "rule_match.tmpl" .Match}} {{ if $rule.Counter }} counter {{ end }} {{ if ne $rule.Comment "" }} comment "{{ $rule.Comment }}" {{ end }}
{{end}}
{{ range $rule := .Netfilter.SourceNATRules }}
{{ .Match.Nftables }}{{ if $rule.Counter }} counter{{ end }}{{ if ne $rule.Comment "" }} comment "{{ $rule.Comment }}"{{ end }}{{ end }}