From: Stefan Schantl Date: Tue, 3 Jun 2014 20:36:32 +0000 (+0200) Subject: guardian.cgi: Autodetect the used interface for red. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7f7285911c65776b061a9a2df018fec66eef064c;p=people%2Fms%2Fipfire-2.x.git guardian.cgi: Autodetect the used interface for red. Signed-off-by: Stefan Schantl --- diff --git a/html/cgi-bin/guardian.cgi b/html/cgi-bin/guardian.cgi index ce842ed556..1ed5b59169 100755 --- a/html/cgi-bin/guardian.cgi +++ b/html/cgi-bin/guardian.cgi @@ -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";