mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 11:13:24 +02:00
OpenVPN: Add start of static routes in client N2N
Fixes: #12529 - If a client N2N configuration will be imported into IPFire systems, a line will be added which calls the --up script to restart the static route initscript. Since this is IPFire specific, i will only be added via import on IPFire system. - Deleted unneeded line in CLIENTCONF section. - Added description to SERVERCONF section. Signed-off-by: ummeegge <erik.kapfer@ipfire.org> Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
@@ -953,6 +953,7 @@ unless(-d "${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}"){mkdir "${General
|
||||
print SERVERCONF "ifconfig $ovsubnet.1 $ovsubnet.2\n";
|
||||
print SERVERCONF "# Client Gateway Network\n";
|
||||
print SERVERCONF "route $remsubnet[0] $remsubnet[1]\n";
|
||||
print SERVERCONF "# Call up script for static routes\n";
|
||||
print SERVERCONF "up \"/etc/init.d/static-routes start\"\n";
|
||||
print SERVERCONF "# tun Device\n";
|
||||
print SERVERCONF "dev tun\n";
|
||||
@@ -1052,7 +1053,6 @@ unless(-d "${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}"){mkdir "${General
|
||||
print CLIENTCONF "ifconfig $ovsubnet.2 $ovsubnet.1\n";
|
||||
print CLIENTCONF "# Server Gateway Network\n";
|
||||
print CLIENTCONF "route $remsubnet[0] $remsubnet[1]\n";
|
||||
print CLIENTCONF "up \"/etc/init.d/static-routes start\"\n";
|
||||
print CLIENTCONF "# tun Device\n";
|
||||
print CLIENTCONF "dev tun\n";
|
||||
print CLIENTCONF "#Logfile for statistics\n";
|
||||
@@ -3333,6 +3333,12 @@ END
|
||||
print FILE "status /var/run/openvpn/$n2nname[0]-n2n 10\n";
|
||||
close FILE;
|
||||
|
||||
# Add static route command to client configuration
|
||||
open(FILE, ">> $tempdir/$uplconffilename") or die 'Unable to open config file.';
|
||||
print FILE "# Call up script for static routes\n";
|
||||
print FILE "up \"/etc/init.d/static-routes start\"\n";
|
||||
close FILE;
|
||||
|
||||
move("$tempdir/$uplconffilename", "${General::swroot}/ovpn/n2nconf/$n2nname[0]/$uplconffilename2");
|
||||
|
||||
if ($? ne 0) {
|
||||
|
||||
Reference in New Issue
Block a user