summaryrefslogtreecommitdiffstats
path: root/etc/inc/gwlb.inc
diff options
context:
space:
mode:
authorErmal LUÇI <eri@pfsense.org>2014-11-27 21:43:15 +0100
committerErmal LUÇI <eri@pfsense.org>2014-11-27 21:44:01 +0100
commit7a63d5d095edf84850715af23c6e380542896a1d (patch)
tree76602fe1b541ea055e68b5951e68d5208e90ecf4 /etc/inc/gwlb.inc
parent0174c48022b15978836ecd7b32d8e2d7a4a638c7 (diff)
downloadpfsense-7a63d5d095edf84850715af23c6e380542896a1d.zip
pfsense-7a63d5d095edf84850715af23c6e380542896a1d.tar.gz
Fixes #4040 for pppoe use static route with -iface option to help when more than one pppoe has the same gateway. Also kill states when reloading apinger to catch up with new route
Diffstat (limited to 'etc/inc/gwlb.inc')
-rw-r--r--etc/inc/gwlb.inc20
1 files changed, 16 insertions, 4 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc
index 83e86f6..e2ff382 100644
--- a/etc/inc/gwlb.inc
+++ b/etc/inc/gwlb.inc
@@ -187,8 +187,14 @@ EOD;
*/
if (is_ipaddrv4($gateway['gateway']) && $gateway['monitor'] != $gateway['gateway']) {
log_error("Removing static route for monitor {$gateway['monitor']} and adding a new route through {$gateway['gateway']}");
- mwexec("/sbin/route change -host " . escapeshellarg($gateway['monitor']) .
- " " . escapeshellarg($gateway['gateway']), true);
+ if (interface_isppp_type($gateway['friendlyiface']))
+ mwexec("/sbin/route change -host " . escapeshellarg($gateway['monitor']) .
+ " -iface " . escapeshellarg($gateway['interface']), true);
+ else
+ mwexec("/sbin/route change -host " . escapeshellarg($gateway['monitor']) .
+ " " . escapeshellarg($gateway['gateway']), true);
+
+ pfSense_kill_states("0.0.0.0/0", $gateway['monitor'], $gateway['interface'], "icmp");
}
} else if ($gateway['ipprotocol'] == "inet6") { // This is an IPv6 gateway...
if ($gateway['monitor'] == $gateway['gateway']) {
@@ -226,8 +232,14 @@ EOD;
*/
if ($gateway['gateway'] != $gateway['monitor']) {
log_error("Removing static route for monitor {$gateway['monitor']} and adding a new route through {$gateway['gateway']}");
- mwexec("/sbin/route change -host -inet6 " . escapeshellarg($gateway['monitor']) .
- " " . escapeshellarg($gateway['gateway']), true);
+ if (interface_isppp_type($gateway['friendlyiface']))
+ mwexec("/sbin/route change -host -inet6 " . escapeshellarg($gateway['monitor']) .
+ " -iface " . escapeshellarg($gateway['interface']), true);
+ else
+ mwexec("/sbin/route change -host -inet6 " . escapeshellarg($gateway['monitor']) .
+ " " . escapeshellarg($gateway['gateway']), true);
+
+ pfSense_kill_states("::0.0.0.0/0", $gateway['monitor'], $gateway['interface'], "icmpv6");
}
} else
continue;
OpenPOWER on IntegriCloud