PVE::ProcFSTools::write_proc_entry("/proc/sys/net/bridge/bridge-nf-call-iptables", "1");
PVE::ProcFSTools::write_proc_entry("/proc/sys/net/bridge/bridge-nf-call-ip6tables", "1");
+ # make sure syncookies are enabled (which is default on newer 3.X kernels anyways)
+ PVE::ProcFSTools::write_proc_entry("/proc/sys/net/ipv4/tcp_syncookies", "1");
+
$bridge_firewall_enabled = 1;
}
if ($direction eq 'OUT') {
$policy = $options->{'policy-out'} || 'ACCEPT'; # allow everything by default
} else {
- $policy = $options->{'policy-in'} || 'DROP'; # allow everything by default
+ $policy = $options->{'policy-in'} || 'DROP'; # allow nothing by default
}
if ($policy eq 'ACCEPT') {
}
}
-sub enablehostfw {
+sub enable_host_firewall {
my ($ruleset, $hostfw_conf, $groups_conf) = @_;
# fixme: allow security groups
my $hostfw_enable = $hostfw_conf &&
!(defined($hostfw_options->{enable}) && ($hostfw_options->{enable} == 0));
- enablehostfw($ruleset, $hostfw_conf, $groups_conf) if $hostfw_enable;
+ enable_host_firewall($ruleset, $hostfw_conf, $groups_conf) if $hostfw_enable;
# generate firewall rules for QEMU VMs
foreach my $vmid (keys %{$vmdata->{qemu}}) {
}
}
- if ($hostfw_enable) {
- # allow traffic from lo (ourself)
- ruleset_addrule($ruleset, "PVEFW-INPUT", "-i lo -j ACCEPT");
- }
-
return $ruleset;
}