mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 19:23:24 +02:00
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:
committed by
Stefan Schantl
parent
6897c329b5
commit
b9ca2fa60f
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user