]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
guardian.cgi: Autodetect the used interface for red.
authorStefan Schantl <stefan.schantl@ipfire.org>
Tue, 3 Jun 2014 20:36:32 +0000 (22:36 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Fri, 29 Jul 2016 11:17:55 +0000 (13:17 +0200)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
html/cgi-bin/guardian.cgi

index ce842ed55607d979edc9a2b777a0e7f8d62f2971..1ed5b59169b01c78a6aefd5803c1185b58658700 100755 (executable)
@@ -543,11 +543,18 @@ sub BuildConfiguration() {
 
        my $configfile = "${General::swroot}/guardian/guardian.conf";
 
+       # We set this to 1 (enabled) to prevent guardian from blocking the ISP gateway.
+       my $HostGatewayByte = "1";
+
+       # Grab interface of red network zone.
+       my $red_interface = &General::get_red_interface();
+
+       # Open configfile for writing.
        open(FILE, ">$configfile");
 
-       print FILE "Interface           red0\n";
+       print FILE "Interface           $red_interface\n";
        print FILE "BlockOption         $settings{'GUARDIAN_BLOCKINTERFACES'}\n";
-       print FILE "HostGatewayByte     1\n";
+       print FILE "HostGatewayByte     $HostGatewayByte\n";
        print FILE "LogFile             $settings{'GUARDIAN_LOGFILE'}\n";
        print FILE "AlertFile           $settings{'GUARDIAN_SNORT_ALERTFILE'}\n";
        print FILE "IgnoreFile          $ignorefile\n";