Add support for generating GeoIP-based firewall rules.

This commit adds support to the rules.pl and firewall-lib.pl to generate
correct iptables commands for inserting GeoIP-based firewall rules
into the kernel.
This commit is contained in:
Alexander Marx
2015-02-17 17:01:42 +01:00
committed by Stefan Schantl
parent 6897c329b5
commit b9ca2fa60f
2 changed files with 34 additions and 2 deletions

View File

@@ -368,13 +368,17 @@ sub buildrules {
my @source_options = ();
if ($source =~ /mac/) {
push(@source_options, $source);
} elsif ($source) {
} elsif ($source =~ /-m geoip/) {
push(@source_options, $source);
} elsif($source) {
push(@source_options, ("-s", $source));
}
# Prepare destination options.
my @destination_options = ();
if ($destination) {
if ($destination =~ /-m geoip/) {
push(@destination_options, $destination);
} elsif ($destination) {
push(@destination_options, ("-d", $destination));
}