aboutsummaryrefslogtreecommitdiffstats
path: root/config/openvpn-client-export/openvpn-client-export.inc
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2011-03-01 12:10:00 -0500
committerjim-p <jimp@pfsense.org>2011-03-01 12:12:09 -0500
commit4d1afb6ab23c1ae8e90209b6988cba17e4b38721 (patch)
treec43f0d0df31265def99651da87a82aa29f979f94 /config/openvpn-client-export/openvpn-client-export.inc
parentbe1443e6c4d1b982d9ddee8843616dbad841debd (diff)
downloadpfsense-packages-4d1afb6ab23c1ae8e90209b6988cba17e4b38721.tar.gz
pfsense-packages-4d1afb6ab23c1ae8e90209b6988cba17e4b38721.tar.bz2
pfsense-packages-4d1afb6ab23c1ae8e90209b6988cba17e4b38721.zip
Finish up shared key client export (for non-pfsense clients)
Diffstat (limited to 'config/openvpn-client-export/openvpn-client-export.inc')
-rwxr-xr-xconfig/openvpn-client-export/openvpn-client-export.inc12
1 files changed, 12 insertions, 0 deletions
diff --git a/config/openvpn-client-export/openvpn-client-export.inc b/config/openvpn-client-export/openvpn-client-export.inc
index 3e8038e4..49ed4ca6 100755
--- a/config/openvpn-client-export/openvpn-client-export.inc
+++ b/config/openvpn-client-export/openvpn-client-export.inc
@@ -51,10 +51,12 @@ function openvpn_client_export_install() {
function openvpn_client_export_deinstall() {
conf_mount_rw();
$phpfile = "vpn_openvpn_export.php";
+ $phpfile2 = "vpn_openvpn_export_shared.php";
$ovpndir = "/usr/local/share/openvpn";
$workdir = "{$ovpndir}/client-export";
unlink_if_exists("/usr/local/www/{$phpfile}");
+ unlink_if_exists("/usr/local/www/{$phpfile2}");
exec("/bin/rm -r {$workdir}");
conf_mount_ro();
}
@@ -548,6 +550,16 @@ function openvpn_client_export_sharedkey_config($srvid, $useaddr, $proxy, $zipco
$mask = gen_subnet_mask($mask);
$conf .= "route $ip $mask\n";
}
+ if (!empty($settings['tunnel_network'])) {
+ list($ip, $mask) = explode('/', $settings['tunnel_network']);
+ $mask = gen_subnet_mask($mask);
+ $baselong = ip2long32($ip) & ip2long($mask);
+ $ip1 = long2ip32($baselong + 1);
+ $ip2 = long2ip32($baselong + 2);
+ $conf .= "ifconfig $ip2 $ip1\n";
+ }
+ $conf .= "keepalive 10 60\n";
+ $conf .= "ping-timer-rem\n";
if (!empty($proxy)) {
if ($proto == "udp") {