mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 11:43:25 +02:00
rules.pl: Move to ipset based data for LOCATIONBLOCK feature.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org> Reviewed-by: Peter Müller <peter.mueller@ipfire.org> Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
committed by
Peter Müller
parent
6babb404cc
commit
0df1d268ed
@@ -671,7 +671,11 @@ sub locationblock {
|
|||||||
# is enabled.
|
# is enabled.
|
||||||
foreach my $location (@locations) {
|
foreach my $location (@locations) {
|
||||||
if(exists $locationsettings{$location} && $locationsettings{$location} eq "on") {
|
if(exists $locationsettings{$location} && $locationsettings{$location} eq "on") {
|
||||||
run("$IPTABLES -A LOCATIONBLOCK -m geoip --src-cc $location -j DROP");
|
# Call function to load the networks list for this country.
|
||||||
|
&ipset_restore($location);
|
||||||
|
|
||||||
|
# Call iptables and create rule to use the loaded ipset list.
|
||||||
|
run("$IPTABLES -A LOCATIONBLOCK -m set --match-set CC_$location src -j DROP");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user