summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorBill Marquette <billm@pfsense.org>2005-07-13 03:09:18 +0000
committerBill Marquette <billm@pfsense.org>2005-07-13 03:09:18 +0000
commit1425e067d6db9b41eafe67070742e3b466178053 (patch)
treec6996ad986ab75ecba8c3f1eb815134202bba875 /usr
parentaca8110ae9f52c81bc88e762fbaf9cb8f2d8d2ca (diff)
downloadpfsense-1425e067d6db9b41eafe67070742e3b466178053.zip
pfsense-1425e067d6db9b41eafe67070742e3b466178053.tar.gz
Merge in virtual IP code
This changeset does the following: merges proxy arp and carp setup menus removes proxy arp menu from left side upgrades config file from 1.7 to 1.8 moves existing carp virtual IP and proxy arp config to new <virtualip> tag removes server NAT (why duplicate work?)
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/carp_status.php26
-rwxr-xr-xusr/local/www/fbegin.inc4
-rwxr-xr-xusr/local/www/firewall_nat.php9
-rwxr-xr-xusr/local/www/firewall_nat_1to1.php11
-rwxr-xr-xusr/local/www/firewall_nat_1to1_edit.php10
-rwxr-xr-xusr/local/www/firewall_nat_edit.php9
-rwxr-xr-xusr/local/www/firewall_nat_out.php11
-rwxr-xr-xusr/local/www/firewall_nat_server.php2
-rwxr-xr-xusr/local/www/guiconfig.inc3
9 files changed, 41 insertions, 44 deletions
diff --git a/usr/local/www/carp_status.php b/usr/local/www/carp_status.php
index 73cc020..33aeca4 100755
--- a/usr/local/www/carp_status.php
+++ b/usr/local/www/carp_status.php
@@ -90,13 +90,18 @@ include("fbegin.inc");
echo "<input type=\"submit\" name=\"disablecarp\" id=\"disablecarp\" value=\"Disable Carp\">";
}
-if(!is_array($config['installedpackages']['carp']['config'])) {
+if(is_array($config['virtualip']['vip'])) {
+ foreach($config['virtualip']['vip'] as $carp) {
+ if ($carp['mode'] == "carp") $carpcount++;
+ }
+ if ($carpcount == 0) {
echo "</td></tr></table><center><br>Could not locate any defined CARP interfaces.";
echo "</center>";
include("fend.inc");
echo "</body></html>";
exit;
+ }
}
?>
@@ -111,21 +116,17 @@ if(!is_array($config['installedpackages']['carp']['config'])) {
</tr>
<?php
-if($config['installedpackages']['carp']['config'] <> "")
+if(is_array($config['virtualip']['vip'])) {
$carpint=0;
- foreach($config['installedpackages']['carp']['config'] as $carp) {
- $ipaddress = $carp['ipaddress'];
- $premption = $carp['premption'];
+ foreach($config['virtualip']['vip'] as $carp) {
+ if ($carp['mode'] != "carp") continue;
+ $ipaddress = $carp['subnet'];
$password = $carp['password'];
- $netmask = $carp['netmask'];
+ $netmask = $carp['subnet_bits'];
$vhid = $carp['vhid'];
$advskew = $carp['advskew'];
- $pfsync = $carp['pfsync'];
- $synciface = $carp['synciface'];
$carp_int = find_carp_interface($ipaddress);
$status = get_carp_interface_status($carp_int);
- if(isset($carp['balancing'])) $balancing = "true"; else $balancing = "false";
- if(isset($carp['premption'])) $premption = "true"; else $premption = "false";
echo "<tr>";
$align = "valign='middle'";
if($carp_enabled == false) {
@@ -147,7 +148,7 @@ if($config['installedpackages']['carp']['config'] <> "")
echo "</tr>";
$carpint++;
}
-
+}
?>
<tr><td>
<center>
@@ -171,5 +172,4 @@ Rounded("div#mainlevel","bl br","#FFF","#eeeeee","smooth");
</script>
</body>
-</html>
-
+</html> \ No newline at end of file
diff --git a/usr/local/www/fbegin.inc b/usr/local/www/fbegin.inc
index d3456f9..8f85ea4 100755
--- a/usr/local/www/fbegin.inc
+++ b/usr/local/www/fbegin.inc
@@ -108,6 +108,7 @@ function showhide_black(tspan, tri) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/firewall_nat.php" class="navlnk">NAT</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/firewall_rules.php" class="navlnk">Rules</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/firewall_shaper.php" class="navlnk">Traffic Shaper</a><br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/firewall_virtual_ip.php" class="navlnk">Virtual IPs</a><br>
<?php echo return_ext_menu("Firewall"); ?>
<strong>Services</strong><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/services_captiveportal.php" class="navlnk">Captive portal</a><br>
@@ -116,7 +117,6 @@ function showhide_black(tspan, tri) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/services_dhcp.php" class="navlnk">DHCP server</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/services_dyndns.php" class="navlnk">Dynamic DNS</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/services_snmp.php" class="navlnk">SNMP</a><br>
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/services_proxyarp.php" class="navlnk">Proxy ARP</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/services_wol.php" class="navlnk">Wake on LAN</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/carp_status.php" class="navlnk">CARP (failover)</a><br>
<?php echo return_ext_menu("Services"); ?>
@@ -208,4 +208,4 @@ function showhide_black(tspan, tri) {
echo "</div>";
}
-?> \ No newline at end of file
+?>
diff --git a/usr/local/www/firewall_nat.php b/usr/local/www/firewall_nat.php
index 01d127d..b2e1c2f 100755
--- a/usr/local/www/firewall_nat.php
+++ b/usr/local/www/firewall_nat.php
@@ -143,11 +143,10 @@ include("head.inc");
<tr><td>
<?php
$tab_array = array();
- $tab_array[0] = array("Port Forward", true, "firewall_nat.php");
- $tab_array[1] = array("NAT Addresses", false, "firewall_nat_server.php");
- $tab_array[2] = array("1:1", false, "firewall_nat_1to1.php");
- $tab_array[3] = array("Outbound", false, "firewall_nat_out.php");
- $tab_array[4] = array("Outbound Load Balancing", false, "firewall_nat_out_load_balancing.php");
+ $tab_array[] = array("Port Forward", true, "firewall_nat.php");
+ $tab_array[] = array("1:1", false, "firewall_nat_1to1.php");
+ $tab_array[] = array("Outbound", false, "firewall_nat_out.php");
+ $tab_array[] = array("Outbound Load Balancing", false, "firewall_nat_out_load_balancing.php");
display_top_tabs($tab_array);
?>
</td></tr>
diff --git a/usr/local/www/firewall_nat_1to1.php b/usr/local/www/firewall_nat_1to1.php
index 9147eb4..3c77bb8 100755
--- a/usr/local/www/firewall_nat_1to1.php
+++ b/usr/local/www/firewall_nat_1to1.php
@@ -85,11 +85,10 @@ include("head.inc");
<table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td>
<?php
$tab_array = array();
- $tab_array[0] = array("Port Forward", false, "firewall_nat.php");
- $tab_array[1] = array("NAT Addresses", false, "firewall_nat_server.php");
- $tab_array[2] = array("1:1", true, "firewall_nat_1to1.php");
- $tab_array[3] = array("Outbound", false, "firewall_nat_out.php");
- $tab_array[4] = array("Outbound Load Balancing", false, "firewall_nat_out_load_balancing.php");
+ $tab_array[] = array("Port Forward", false, "firewall_nat.php");
+ $tab_array[] = array("1:1", true, "firewall_nat_1to1.php");
+ $tab_array[] = array("Outbound", false, "firewall_nat_out.php");
+ $tab_array[] = array("Outbound Load Balancing", false, "firewall_nat_out_load_balancing.php");
display_top_tabs($tab_array);
?>
</td></tr>
@@ -148,7 +147,7 @@ include("head.inc");
<tr>
<td colspan="4">
<p><span class="vexpl"><span class="red"><strong>Note:<br>
- </strong></span>Depending on the way your WAN connection is setup, you may also need <a href="services_proxyarp.php">proxy ARP</a>.</span></p>
+ </strong></span>Depending on the way your WAN connection is setup, you may also need a <a href="firewall_virtual_ip.php">Virtual IP</a>.</span></p>
</td>
<tr>
</table>
diff --git a/usr/local/www/firewall_nat_1to1_edit.php b/usr/local/www/firewall_nat_1to1_edit.php
index 26fed2a..66f0ccd 100755
--- a/usr/local/www/firewall_nat_1to1_edit.php
+++ b/usr/local/www/firewall_nat_1to1_edit.php
@@ -96,12 +96,12 @@ if ($_POST) {
}
}
- /* check for overlaps with server NAT */
- if (is_array($config['nat']['servernat'])) {
- foreach ($config['nat']['servernat'] as $natent) {
+ /* check for overlaps with Virtual IPs */
+ if (is_array($config['virtualip']['vip'])) {
+ foreach ($config['virtualip']['vip'] as $vipent) {
if (check_subnets_overlap($_POST['external'], $_POST['subnet'],
- $natent['ipaddr'], 32)) {
- $input_errors[] = "A server NAT entry overlaps with the specified external subnet.";
+ $vipent['subnet'], 32)) {
+ $input_errors[] = "Virtual IP entry overlaps with the specified external subnet.";
break;
}
}
diff --git a/usr/local/www/firewall_nat_edit.php b/usr/local/www/firewall_nat_edit.php
index 7ca4a14..7458010e 100755
--- a/usr/local/www/firewall_nat_edit.php
+++ b/usr/local/www/firewall_nat_edit.php
@@ -253,16 +253,15 @@ function ext_rep_change() {
<select name="extaddr" class="formfld">
<option value="" <?php if (!$pconfig['extaddr']) echo "selected"; ?>>Interface address</option>
<?php
- if (is_array($config['nat']['servernat'])):
- foreach ($config['nat']['servernat'] as $sn): ?>
- <option value="<?=$sn['ipaddr'];?>" <?php if ($sn['ipaddr'] == $pconfig['extaddr']) echo "selected"; ?>><?=htmlspecialchars("{$sn['ipaddr']} ({$sn['descr']})");?></option>
+ if (is_array($config['virtualip']['vip'])):
+ foreach ($config['virtualip']['vip'] as $sn): ?>
+ <option value="<?=$sn['subnet'];?>" <?php if ($sn['subnet'] == $pconfig['extaddr']) echo "selected"; ?>><?=htmlspecialchars("{$sn['subnet']} ({$sn['descr']})");?></option>
<?php endforeach; endif; ?>
<option value="any" <?php if($pconfig['extaddr'] == "any") echo "selected"; ?>>any</option>
</select><br>
<span class="vexpl">
If you want this rule to apply to another IP address than the IP address of the interface chosen above,
- select it here (you need to define IP addresses on the
- <a href="firewall_nat_server.php">NAT Addresses</a> page first). Also note that if you are trying to redirect connections on the LAN select the "any" option.</span></td>
+ select it here (you need to define <a href="firewall_virtual_ip.php">Virtual IP</a> addresses on the first). Also note that if you are trying to redirect connections on the LAN select the "any" option.</span></td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Protocol</td>
diff --git a/usr/local/www/firewall_nat_out.php b/usr/local/www/firewall_nat_out.php
index f8a3f2a..d7e556a 100755
--- a/usr/local/www/firewall_nat_out.php
+++ b/usr/local/www/firewall_nat_out.php
@@ -189,11 +189,10 @@ include("head.inc");
<table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td>
<?php
$tab_array = array();
- $tab_array[0] = array("Port Forward", false, "firewall_nat.php");
- $tab_array[1] = array("NAT Addresses", false, "firewall_nat_server.php");
- $tab_array[2] = array("1:1", false, "firewall_nat_1to1.php");
- $tab_array[3] = array("Outbound", true, "firewall_nat_out.php");
- $tab_array[4] = array("Outbound Load Balancing", false, "firewall_nat_out_load_balancing.php");
+ $tab_array[] = array("Port Forward", false, "firewall_nat.php");
+ $tab_array[] = array("1:1", false, "firewall_nat_1to1.php");
+ $tab_array[] = array("Outbound", true, "firewall_nat_out.php");
+ $tab_array[] = array("Outbound Load Balancing", false, "firewall_nat_out_load_balancing.php");
display_top_tabs($tab_array);
?>
</td></tr>
@@ -222,7 +221,7 @@ include("head.inc");
rules will be automatically generated anymore. Instead, only the mappings
you specify below will be used. With advanced outbound NAT disabled,
a mapping is automatically created for each interface's subnet
- (except WAN).</span> If you use target addresses other than the WAN interface's IP address, then depending on<span class="vexpl"> the way your WAN connection is setup, you may also need <a href="services_proxyarp.php">proxy ARP</a>.</span><br>
+ (except WAN).</span> If you use target addresses other than the WAN interface's IP address, then depending on<span class="vexpl"> the way your WAN connection is setup, you may also need a <a href="firewall_virtual_ip.php">Virtual IP</a>.</span><br>
<br>
You may enter your own mappings below.</p>
</td>
diff --git a/usr/local/www/firewall_nat_server.php b/usr/local/www/firewall_nat_server.php
index 8c58b7e..6c40db5 100755
--- a/usr/local/www/firewall_nat_server.php
+++ b/usr/local/www/firewall_nat_server.php
@@ -146,7 +146,7 @@ include("head.inc");
<tr>
<td colspan="2">
<p><span class="vexpl"><span class="red"><strong>Note:<br>
- </strong></span>The external IP addresses defined on this page may be used in <a href="firewall_nat.php">inbound NAT</a> mappings. Depending on the way your WAN connection is setup, you may also need <a href="services_proxyarp.php">proxy ARP</a>.</span></p>
+ </strong></span>The external IP addresses defined on this page may be used in <a href="firewall_nat.php">inbound NAT</a> mappings. Depending on the way your WAN connection is setup, you may also need a <a href="services_virtual_ip.php">Virtual IP</a>.</span></p>
</td>
</tr>
</table>
diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc
index 431d967..f0205b2 100755
--- a/usr/local/www/guiconfig.inc
+++ b/usr/local/www/guiconfig.inc
@@ -64,6 +64,7 @@ $d_sysrebootreqd_path = $g['varrun_path'] . "/sysreboot.reqd";
$d_passthrumacsdirty_path = $g['varrun_path'] . "/passthrumacs.dirty";
$d_allowedipsdirty_path = $g['varrun_path'] . "/allowedips.dirty";
$d_ovpnclidirty_path = $g['varrun_path'] . "/ovpnclient.dirty";
+$d_vipconfdirty_path = $g['varrun_path'] . "/vip.conf.dirty";
/* used by progress bar */
$lastseen = "-1";
@@ -605,4 +606,4 @@ function ipsec_ca_sort() {
}
-?> \ No newline at end of file
+?>
OpenPOWER on IntegriCloud