Revert "ruleset: dispatch ct states using verdict map"
[project/firewall4.git] / tests / 02_zones / 03_masq_src_dest_restrictions
index da1ae91b069459e5ba09739559548fa3b35ac1f4..011ef8912adea405c77bd18675c5760c2d8e1e23 100644 (file)
@@ -95,17 +95,16 @@ table inet fw4
 flush table inet fw4
 
 table inet fw4 {
-       #
-       # Set definitions
-       #
-
-
        #
        # Defines
        #
 
        define test1_devices = { "zone1" }
+       define test1_subnets = {  }
+
        define test2_devices = { "zone2" }
+       define test2_subnets = {  }
+
 
        #
        # User includes
@@ -146,6 +145,10 @@ table inet fw4 {
                oifname "zone2" jump output_test2 comment "!fw4: Handle test2 IPv4/IPv6 output traffic"
        }
 
+       chain prerouting {
+               type filter hook prerouting priority filter; policy accept;
+       }
+
        chain handle_reject {
                meta l4proto tcp reject with tcp reset comment "!fw4: Reject TCP traffic"
                reject with icmpx type port-unreachable comment "!fw4: Reject any other traffic"
@@ -168,6 +171,7 @@ table inet fw4 {
        }
 
        chain accept_to_test1 {
+               meta nfproto ipv4 oifname "zone1" ct state invalid counter drop comment "!fw4: Prevent NAT leakage"
                oifname "zone1" counter accept comment "!fw4: accept test1 IPv4/IPv6 traffic"
        }
 
@@ -216,7 +220,7 @@ table inet fw4 {
 
 
        #
-       # Raw rules (notrack & helper)
+       # Raw rules (notrack)
        #
 
        chain raw_prerouting {
@@ -236,8 +240,16 @@ table inet fw4 {
                type filter hook prerouting priority mangle; policy accept;
        }
 
+       chain mangle_postrouting {
+               type filter hook postrouting priority mangle; policy accept;
+       }
+
+       chain mangle_input {
+               type filter hook input priority mangle; policy accept;
+       }
+
        chain mangle_output {
-               type filter hook output priority mangle; policy accept;
+               type route hook output priority mangle; policy accept;
        }
 
        chain mangle_forward {