aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-05-05 03:32:55 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-05-05 03:32:55 +0000
commitfba4849c8e82d17951ee634446fe75bc10087111 (patch)
treec1fa961aa77145c9bc1209997711deead0363def
parent61e49b0c437553fd1bc4ecc86a28d7afa1d67477 (diff)
downloadpfsense-packages-fba4849c8e82d17951ee634446fe75bc10087111.tar.gz
pfsense-packages-fba4849c8e82d17951ee634446fe75bc10087111.tar.bz2
pfsense-packages-fba4849c8e82d17951ee634446fe75bc10087111.zip
Setup carp interfaces before setting preempt and bringing them up.
-rw-r--r--packages/carp.xml40
1 files changed, 20 insertions, 20 deletions
diff --git a/packages/carp.xml b/packages/carp.xml
index cdf7d11a..13e3b752 100644
--- a/packages/carp.xml
+++ b/packages/carp.xml
@@ -222,24 +222,8 @@
global $config;
$carp_instances_counter = 0;
$pfsync_instances_counter = 0;
- if($config['installedpackages']['carpsettings']['config'] != "")
- foreach($config['installedpackages']['carpsettings']['config'] as $carp)
- if($carp['pfsyncenabled'] != "") {
- $pfsync = 1;
- if($carp['premption'] != "")
- fwrite($fout, "/sbin/sysctl net.inet.carp.preempt=1\n");
- if($carp['balancing'] != "")
- fwrite($fout, "/sbin/sysctl net.inet.arpbalance=1\n");
- $carp_sync_int = convert_friendly_interface_to_real_interface_name($carp['pfsyncinterface']);
- fwrite($fout, "/sbin/ifconfig pfsync0 create\n");
- fwrite($fout, "/sbin/ifconfig pfsync0 syncdev " . $carp_sync_int . "\n");
- fwrite($fout, "/sbin/ifconfig {$carp_sync_int} up\n");
- fwrite($fout, "/sbin/ifconfig pfsync0 up\n");
- fwrite($fout, "sleep 10\n");
- $pfsync_instances_counter++;
- }
if($config['installedpackages']['carp']['config'] != "") {
- foreach($config['installedpackages']['carp']['config'] as $carp) {
+ foreach($config['installedpackages']['carp']['config'] as $carp) {
/*
* create the carp interface
*/
@@ -254,9 +238,25 @@
fwrite($fout, $carp_command . "\n");
fwrite($fout, "/sbin/ifconfig carp{$carp_instances_counter} up\n");
$carp_instances_counter++;
- }
- }
-
+ }
+ }
+ if($config['installedpackages']['carpsettings']['config'] != "") {
+ foreach($config['installedpackages']['carpsettings']['config'] as $carp)
+ if($carp['pfsyncenabled'] != "") {
+ $pfsync = 1;
+ if($carp['premption'] != "")
+ fwrite($fout, "/sbin/sysctl net.inet.carp.preempt=1\n");
+ if($carp['balancing'] != "")
+ fwrite($fout, "/sbin/sysctl net.inet.arpbalance=1\n");
+ $carp_sync_int = convert_friendly_interface_to_real_interface_name($carp['pfsyncinterface']);
+ fwrite($fout, "/sbin/ifconfig pfsync0 create\n");
+ fwrite($fout, "/sbin/ifconfig pfsync0 syncdev " . $carp_sync_int . "\n");
+ fwrite($fout, "/sbin/ifconfig {$carp_sync_int} up\n");
+ fwrite($fout, "/sbin/ifconfig pfsync0 up\n");
+ fwrite($fout, "sleep 10\n");
+ $pfsync_instances_counter++;
+ }
+ }
fclose($fout);
chmod("/usr/local/pkg/pf/carp.sh", 0755);
mwexec("/usr/local/pkg/pf/carp.sh");