]> git.proxmox.com Git - pve-firewall.git/commitdiff
implement nosmurfs option for hiost firewall
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 20 Mar 2014 06:53:59 +0000 (07:53 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 20 Mar 2014 06:57:52 +0000 (07:57 +0100)
example/100.fw
example/host.fw
src/PVE/Firewall.pm

index 94f178d8b6d5ed6f43fec257f507ea63d98efc6e..a9179310dad6eb21b8a4493d7e205c80d58f34b4 100644 (file)
@@ -19,8 +19,8 @@ log_level_in: info
 # disable log for outgoing connections
 log_level_out: nolog
 
 # disable log for outgoing connections
 log_level_out: nolog
 
-# filter SMURFS
-nosmurfs: 1
+# disable SMURFS filter
+nosmurfs: 0
 
 # filter illegal combinations of TCP flags
 tcpflags: 1
 
 # filter illegal combinations of TCP flags
 tcpflags: 1
index e38b2a58b24fec3e55a9da53b1d4caa010fd2f96..663d2d7f05b5d0506cfaa449a3036fd5b078b565 100644 (file)
@@ -20,6 +20,9 @@ nf_conntrack_max: 196608
 # you need to enable that explicitly
 allow_bridge_route: 1
 
 # you need to enable that explicitly
 allow_bridge_route: 1
 
+# disable SMURFS filter
+nosmurfs: 0
+
 # filter illegal combinations of TCP flags
 tcpflags: 1
 
 # filter illegal combinations of TCP flags
 tcpflags: 1
 
index a929b54ac755b1d0c356c46282867a7c7d2dc3af..6d715c20f6348fd7fe745b1cff1f27824e34b0a8 100644 (file)
@@ -1125,6 +1125,10 @@ sub enable_host_firewall {
 
     my $loglevel = get_option_log_level($options, "log_level_in");
 
 
     my $loglevel = get_option_log_level($options, "log_level_in");
 
+    if (!(defined($options->{nosmurfs}) && $options->{nosmurfs} == 0)) {
+       ruleset_addrule($ruleset, $chain, "-m conntrack --ctstate INVALID,NEW -j PVEFW-smurfs");
+    }
+
     if ($options->{tcpflags}) {
        ruleset_addrule($ruleset, $chain, "-p tcp -j PVEFW-tcpflags");
     }
     if ($options->{tcpflags}) {
        ruleset_addrule($ruleset, $chain, "-p tcp -j PVEFW-tcpflags");
     }