From 4d1afb6ab23c1ae8e90209b6988cba17e4b38721 Mon Sep 17 00:00:00 2001 From: jim-p Date: Tue, 1 Mar 2011 12:10:00 -0500 Subject: Finish up shared key client export (for non-pfsense clients) --- config/openvpn-client-export/openvpn-client-export.inc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'config/openvpn-client-export/openvpn-client-export.inc') 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") { -- cgit v1.2.3