Add IPSec 'ipalias' VIP support. Ticket #1041

This commit is contained in:
Pierre POMES 2010-12-10 20:42:45 -05:00
parent 2c6b0d67b4
commit 25f6730aed
3 changed files with 18 additions and 6 deletions

View File

@ -123,12 +123,18 @@ function ipsec_ikeid_next() {
*/
function ipsec_get_phase1_src(& $ph1ent) {
if ($ph1ent['interface'])
$if = $ph1ent['interface'];
else
if ($ph1ent['interface']) {
if (!is_ipaddr($ph1ent['interface'])) {
$if = $ph1ent['interface'];
$interfaceip = get_interface_ip($if);
} else {
$interfaceip=$ph1ent['interface'];
}
}
else {
$if = "wan";
$interfaceip = get_interface_ip($if);
$interfaceip = get_interface_ip($if);
}
return $interfaceip;
}

View File

@ -191,7 +191,10 @@ include("head.inc");
$iflabels = get_configured_interface_with_descr();
$carplist = get_configured_carp_interface_list();
foreach ($carplist as $cif => $carpip)
$iflabels[$cif] = strtoupper($cif) . " ({$carpip})";
$iflabels[$cif] = $carpip." (".get_vip_descr($carpip).")";
$aliaslist = get_configured_ip_aliases_list();
foreach ($aliaslist as $aliasip => $aliasif)
$iflabels[$aliasip] = $aliasip." (".get_vip_descr($aliasip).")";
$if = htmlspecialchars($iflabels[$ph1ent['interface']]);
}
else

View File

@ -510,6 +510,9 @@ function dpdchkbox_change() {
$carplist = get_configured_carp_interface_list();
foreach ($carplist as $cif => $carpip)
$interfaces[$cif] = $carpip." (".get_vip_descr($carpip).")";
$aliaslist = get_configured_ip_aliases_list();
foreach ($aliaslist as $aliasip => $aliasif)
$interfaces[$aliasip] = $aliasip." (".get_vip_descr($aliasip).")" = $aliasip." (".get_vip_descr($aliasip).")" = $aliasip." (".get_vip_descr($aliasip).")";
foreach ($interfaces as $iface => $ifacename):
?>
<option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected"; ?>>