mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
OpenVPN: Allow to set routes to IPsec networks
This makes hub-and-spoke designs with OpenVPN RW and IPsec N2N easier to configure Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
@@ -19,6 +19,7 @@ srv/web/ipfire/cgi-bin/logs.cgi/ids.dat
|
||||
srv/web/ipfire/cgi-bin/logs.cgi/showrequestfromcountry.dat
|
||||
srv/web/ipfire/cgi-bin/netexternal.cgi
|
||||
srv/web/ipfire/cgi-bin/netother.cgi
|
||||
srv/web/ipfire/cgi-bin/ovpnmain.cgi
|
||||
srv/web/ipfire/cgi-bin/routing.cgi
|
||||
srv/web/ipfire/cgi-bin/vpnmain.cgi
|
||||
srv/web/ipfire/html/themes/darkdos/include/functions.pl
|
||||
|
||||
@@ -4975,6 +4975,35 @@ END
|
||||
}
|
||||
if ($set == '1' && $#temp != -1){ print"<option selected>$temp[1]</option>";$set=0;}elsif($set == '0' && $#temp != -1){print"<option>$temp[1]</option>";}
|
||||
}
|
||||
|
||||
my %vpnconfig = ();
|
||||
&General::readhasharray("${General::swroot}/vpn/config", \%vpnconfig);
|
||||
foreach my $vpn (keys %vpnconfig) {
|
||||
# Skip all disabled VPN connections
|
||||
my $enabled = $vpnconfig{$vpn}[0];
|
||||
next unless ($enabled eq "on");
|
||||
|
||||
my $name = $vpnconfig{$vpn}[1];
|
||||
|
||||
# Remote subnets
|
||||
my @networks = split(/\|/, $vpnconfig{$vpn}[11]);
|
||||
foreach my $network (@networks) {
|
||||
my $selected = "";
|
||||
|
||||
foreach my $key (keys %ccdroute2hash) {
|
||||
if ($ccdroute2hash{$key}[0] eq $cgiparams{'NAME'}) {
|
||||
foreach my $i (1 .. $#{$ccdroute2hash{$key}}) {
|
||||
if ($ccdroute2hash{$key}[$i] eq $network) {
|
||||
$selected = "selected";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print "<option value=\"$network\" $selected>$name ($network)</option>\n";
|
||||
}
|
||||
}
|
||||
|
||||
#check if green,blue,orange are defined for client
|
||||
foreach my $key (keys %ccdroute2hash) {
|
||||
if($ccdroute2hash{$key}[0] eq $cgiparams{'NAME'}){
|
||||
|
||||
Reference in New Issue
Block a user