diff options
author | jim-p <jimp@pfsense.org> | 2013-06-06 13:50:28 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2013-06-06 13:55:10 -0400 |
commit | 56bf3ef146ebc41c60ae7ab1fc0d7e57b0db55b7 (patch) | |
tree | c1091fc0ecf4de1ec2f6ca17fd3427b3c5072da0 | |
parent | 00a7438c5bdb8e4c607c7a00bc2ca9be133f3a7a (diff) | |
download | pfsense-56bf3ef146ebc41c60ae7ab1fc0d7e57b0db55b7.zip pfsense-56bf3ef146ebc41c60ae7ab1fc0d7e57b0db55b7.tar.gz |
Allow selecting "Localhost" as an interface for IP Alias VIPs - this way you can make IP Alias VIPs to use for binding in a routed scenario with CARP without creating an IP conflict.
-rwxr-xr-x | usr/local/www/firewall_virtual_ip.php | 1 | ||||
-rwxr-xr-x | usr/local/www/firewall_virtual_ip_edit.php | 15 |
2 files changed, 11 insertions, 5 deletions
diff --git a/usr/local/www/firewall_virtual_ip.php b/usr/local/www/firewall_virtual_ip.php index 55f6383..2a17a9e 100755 --- a/usr/local/www/firewall_virtual_ip.php +++ b/usr/local/www/firewall_virtual_ip.php @@ -240,6 +240,7 @@ include("head.inc"); $carplist = get_configured_carp_interface_list(); foreach ($carplist as $cif => $carpip) $interfaces[$cif] = $carpip." (".get_vip_descr($carpip).")"; + $interfaces['lo0'] = "Localhost"; ?> <?php $i = 0; foreach ($a_vip as $vipent): ?> <?php if($vipent['subnet'] <> "" or $vipent['range'] <> "" or diff --git a/usr/local/www/firewall_virtual_ip_edit.php b/usr/local/www/firewall_virtual_ip_edit.php index c906b4c..0dc6ceb 100755 --- a/usr/local/www/firewall_virtual_ip_edit.php +++ b/usr/local/www/firewall_virtual_ip_edit.php @@ -178,6 +178,8 @@ if ($_POST) { $input_errors[] = sprintf(gettext("Sorry, we could not locate an interface with a matching subnet for %s. Please add an IP alias in this subnet on this interface."),$cannot_find); } + if ($_POST['interface'] == "lo0") + $input_errors[] = gettext("For this type of vip localhost is not allowed."); if (strstr($_POST['interface'], "_vip")) $input_errors[] = gettext("For this type of vip a carp parent is not allowed."); break; @@ -199,6 +201,8 @@ if ($_POST) { } break; default: + if ($_POST['interface'] == "lo0") + $input_errors[] = gettext("For this type of vip localhost is not allowed."); if (strstr($_POST['interface'], "_vip")) $input_errors[] = gettext("For this type of VIP, a CARP parent is not allowed."); break; @@ -381,11 +385,12 @@ function typesel_change() { <td width="78%" class="vtable"> <select name="interface" class="formselect"> <?php - $interfaces = get_configured_interface_with_descr(false, true); - $carplist = get_configured_carp_interface_list(); - foreach ($carplist as $cif => $carpip) - $interfaces[$cif] = $carpip." (".get_vip_descr($carpip).")"; - foreach ($interfaces as $iface => $ifacename): ?> + $interfaces = get_configured_interface_with_descr(false, true); + $carplist = get_configured_carp_interface_list(); + foreach ($carplist as $cif => $carpip) + $interfaces[$cif] = $carpip." (".get_vip_descr($carpip).")"; + $interfaces['lo0'] = "Localhost"; + foreach ($interfaces as $iface => $ifacename): ?> <option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected=\"selected\""; ?>> <?=htmlspecialchars($ifacename);?> </option> |