summaryrefslogtreecommitdiffstats
path: root/etc/inc/openvpn.inc
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2008-07-01 15:39:37 +0000
committerErmal Luçi <eri@pfsense.org>2008-07-01 15:39:37 +0000
commit8874c692cce5de453d39e57a44411cf46d911836 (patch)
treec017e2d7f69861371899310e785ca274a54fcf7c /etc/inc/openvpn.inc
parent8dfbe37a253a7a86a0cd747736c32dbcc34af404 (diff)
downloadpfsense-8874c692cce5de453d39e57a44411cf46d911836.zip
pfsense-8874c692cce5de453d39e57a44411cf46d911836.tar.gz
Correctly name clients and server interfaces otherwise we have clashes.
Diffstat (limited to 'etc/inc/openvpn.inc')
-rw-r--r--etc/inc/openvpn.inc23
1 files changed, 15 insertions, 8 deletions
diff --git a/etc/inc/openvpn.inc b/etc/inc/openvpn.inc
index 25d54c5..c2d2e28 100644
--- a/etc/inc/openvpn.inc
+++ b/etc/inc/openvpn.inc
@@ -361,19 +361,26 @@ function openvpn_reconfigure($mode, $id) {
* be sure to change it even on the openvpn command parameters at
* openvpn_restart() function.
*/
+
+ if ($mode == "client")
+ $ovpndevice = "ovpnc{$id}";
+ else
+ $ovpndevice = "ovpn{$id}";
+
if (!$g['booting'])
- mwexec("/sbin/ifconfig ovpn{$id} destroy");
- mwexec("/sbin/ifconfig tun{$id} create");
- mwexec("/sbin/ifconfig tun{$id} name ovpn{$id}");
- mwexec("/sbin/ifconfig ovpn{$id} group openvpn");
+ mwexec("/sbin/ifconfig {$ovpndevice} destroy");
+
+ $tunname = exec("/sbin/ifconfig tun create");
+ mwexec("/sbin/ifconfig {$tunname} name {$ovpndevice}");
+ mwexec("/sbin/ifconfig {$ovpndevice} group openvpn");
$pidfile = $g['varrun_path'] . "/openvpn_{$mode}{$id}.pid";
$proto = ($settings['protocol'] == 'UDP' ? 'udp' : "tcp-{$mode}");
$cipher = $settings['crypto'];
- $openvpn_conf = "dev ovpn{$id}\n";
- $openvpn_conf .= "dev-type tun\n";
- $openvpn_conf .= "dev-node /dev/tun{$id}\n";
$openvpn_conf .= <<<EOD
+dev {$ovpndevice}
+dev-type tun
+dev-node /dev/{$tunname}
writepid $pidfile
#user nobody
#group nobody
@@ -823,4 +830,4 @@ EOD;
print($javascript);
}
-?> \ No newline at end of file
+?>
OpenPOWER on IntegriCloud