diff options
author | pierrepomes <pierre.pomes@interface-tech.com> | 2009-12-10 17:34:17 -0500 |
---|---|---|
committer | pierrepomes <pierre.pomes@interface-tech.com> | 2009-12-10 17:34:30 -0500 |
commit | 67b0902fe1979b904b2f56a61d59309d971138da (patch) | |
tree | 5ac4d19f309ed3846b502a3361364d7a95c3cdf8 /usr/local | |
parent | 942fdd555964d4854e38f8508ffe6acc190b94f4 (diff) | |
download | pfsense-67b0902fe1979b904b2f56a61d59309d971138da.zip pfsense-67b0902fe1979b904b2f56a61d59309d971138da.tar.gz |
Add IP alias and 'any' support to OpenVPN. Feedback #69
Diffstat (limited to 'usr/local')
-rw-r--r-- | usr/local/www/vpn_openvpn_client.php | 11 | ||||
-rw-r--r-- | usr/local/www/vpn_openvpn_server.php | 11 |
2 files changed, 18 insertions, 4 deletions
diff --git a/usr/local/www/vpn_openvpn_client.php b/usr/local/www/vpn_openvpn_client.php index f3cc139..a7abb79 100644 --- a/usr/local/www/vpn_openvpn_client.php +++ b/usr/local/www/vpn_openvpn_client.php @@ -81,6 +81,9 @@ if($_GET['act']=="edit"){ $pconfig['mode'] = $a_client[$id]['mode']; $pconfig['protocol'] = $a_client[$id]['protocol']; $pconfig['interface'] = $a_client[$id]['interface']; + if (!empty($a_client[$id]['ipaddr'])) { + $pconfig['interface'] = $pconfig['interface'] . '|' . $a_client[$id]['ipaddr']; + } $pconfig['local_port'] = $a_client[$id]['local_port']; $pconfig['server_addr'] = $a_client[$id]['server_addr']; $pconfig['server_port'] = $a_client[$id]['server_port']; @@ -194,7 +197,7 @@ if ($_POST) { $client['disable'] = $pconfig['disable']; $client['protocol'] = $pconfig['protocol']; - $client['interface'] = $pconfig['interface']; + list($client['interface'], $client['ipaddr']) = explode ("|",$pconfig['interface']); $client['local_port'] = $pconfig['local_port']; $client['server_addr'] = $pconfig['server_addr']; $client['server_port'] = $pconfig['server_port']; @@ -387,7 +390,11 @@ function autotls_change() { $interfaces = get_configured_interface_with_descr(); $carplist = get_configured_carp_interface_list(); foreach ($carplist as $cif => $carpip) - $interfaces[$cif] = strtoupper($cif) . " ({$carpip})"; + $interfaces[$cif.'|'.$carpip] = strtoupper($cif) . " ({$carpip})"; + $aliaslist = get_configured_ip_aliases_list(); + foreach ($aliaslist as $aliasip => $aliasif) + $interfaces[$aliasif.'|'.$aliasip] = strtoupper($aliasif) . " ({$aliasip})"; + $interfaces['any'] = "any"; foreach ($interfaces as $iface => $ifacename): $selected = ""; if ($iface == $pconfig['interface']) diff --git a/usr/local/www/vpn_openvpn_server.php b/usr/local/www/vpn_openvpn_server.php index 008fd47..8686c29 100644 --- a/usr/local/www/vpn_openvpn_server.php +++ b/usr/local/www/vpn_openvpn_server.php @@ -83,6 +83,9 @@ if($_GET['act']=="edit"){ $pconfig['mode'] = $a_server[$id]['mode']; $pconfig['protocol'] = $a_server[$id]['protocol']; $pconfig['interface'] = $a_server[$id]['interface']; + if (!empty($a_server[$id]['ipaddr'])) { + $pconfig['interface'] = $pconfig['interface'] . '|' . $a_server[$id]['ipaddr']; + } $pconfig['local_port'] = $a_server[$id]['local_port']; $pconfig['description'] = $a_server[$id]['description']; $pconfig['custom_options'] = $a_server[$id]['custom_options']; @@ -257,7 +260,7 @@ if ($_POST) { $server['disable'] = $pconfig['disable']; $server['mode'] = $pconfig['mode']; $server['protocol'] = $pconfig['protocol']; - $server['interface'] = $pconfig['interface']; + list($server['interface'], $server['ipaddr']) = explode ("|",$pconfig['interface']); $server['local_port'] = $pconfig['local_port']; $server['description'] = $pconfig['description']; $server['custom_options'] = $pconfig['custom_options']; @@ -550,7 +553,11 @@ function netbios_change() { $interfaces = get_configured_interface_with_descr(); $carplist = get_configured_carp_interface_list(); foreach ($carplist as $cif => $carpip) - $interfaces[$cif] = strtoupper($cif) . " ({$carpip})"; + $interfaces[$cif.'|'.$carpip] = strtoupper($cif) . " ({$carpip})"; + $aliaslist = get_configured_ip_aliases_list(); + foreach ($aliaslist as $aliasip => $aliasif) + $interfaces[$aliasif.'|'.$aliasip] = strtoupper($aliasif) . " ({$aliasip})"; + $interfaces['any'] = "any"; foreach ($interfaces as $iface => $ifacename): $selected = ""; if ($iface == $pconfig['interface']) |