aboutsummaryrefslogtreecommitdiff
path: root/utils/cni-plugins-nft/patches/020-fw4-fix-default-table-and-chain-names.patch
blob: d9a8448b26a21e6f8f0c8e39ca13230e39c6cc0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
--- a/pkg/firewall/config.go
+++ b/pkg/firewall/config.go
@@ -31,7 +31,7 @@ func parseConfigFromBytes(data []byte) (
 
 	// Default the filter table name to filter
 	if conf.FilterTableName == "" {
-		conf.FilterTableName = "filter"
+		conf.FilterTableName = "fw4"
 	}
 
 	// Default the forwarding chain name to forward
@@ -41,12 +41,12 @@ func parseConfigFromBytes(data []byte) (
 
 	// Default the nat table name to nat
 	if conf.NatTableName == "" {
-		conf.NatTableName = "nat"
+		conf.NatTableName = "fw4"
 	}
 
 	// Default the postrouting chain name to postrouting
 	if conf.PostRoutingNatChainName == "" {
-		conf.PostRoutingNatChainName = "postrouting"
+		conf.PostRoutingNatChainName = "srcnat"
 	}
 
 	// Parse previous result.
--- a/pkg/portmap/config.go
+++ b/pkg/portmap/config.go
@@ -56,16 +56,16 @@ func parseConfigFromBytes(data []byte, i
 
 	// Set default values
 	if conf.NatTableName == "" {
-		conf.NatTableName = "nat"
+		conf.NatTableName = "fw4"
 	}
 	if conf.RawTableName == "" {
-		conf.RawTableName = "raw"
+		conf.RawTableName = "fw4"
 	}
 	if conf.PostRoutingNatChainName == "" {
-		conf.PostRoutingNatChainName = "postrouting"
+		conf.PostRoutingNatChainName = "srcnat"
 	}
 	if conf.PreRoutingNatChainName == "" {
-		conf.PreRoutingNatChainName = "prerouting"
+		conf.PreRoutingNatChainName = "dstnat"
 	}
 	if conf.OutputNatChainName == "" {
 		conf.OutputNatChainName = "output"
@@ -76,14 +76,14 @@ func parseConfigFromBytes(data []byte, i
 	}
 
 	if conf.RawTableName == "" {
-		conf.RawTableName = "raw"
+		conf.RawTableName = "fw4"
 	}
 	if conf.PreRoutingRawChainName == "" {
-		conf.PreRoutingRawChainName = "prerouting"
+		conf.PreRoutingRawChainName = "dstnat"
 	}
 
 	if conf.FilterTableName == "" {
-		conf.FilterTableName = "filter"
+		conf.FilterTableName = "fw4"
 	}
 	if conf.ForwardFilterChainName == "" {
 		conf.ForwardFilterChainName = "forward"