summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-03-18 20:51:06 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-03-18 20:51:06 +0000
commitfef3a8efd27f40aa8663e0eb5eed8b8b45d6e77a (patch)
treedb5c5dab7e67ab5c4d06ad09fffa1b962b51d18d /etc
parent0f030fdb84fa050824a554c622f70e148334649d (diff)
downloadpfsense-fef3a8efd27f40aa8663e0eb5eed8b8b45d6e77a.zip
pfsense-fef3a8efd27f40aa8663e0eb5eed8b8b45d6e77a.tar.gz
Allow the interface to be the gateway. This allows someone with multiple wans to route traffic out a correct interface such as DNS traffic, etc.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/system.inc12
1 files changed, 9 insertions, 3 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index 212c3dc..5e4910e 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -191,9 +191,15 @@ function system_routing_configure() {
}
foreach ($config['staticroutes']['route'] as $rtent) {
- mwexec("/sbin/route add " . escapeshellarg($rtent['network']) .
- " " . escapeshellarg($rtent['gateway']));
-
+ if(isset($rtent['interfacegateway'])) {
+ echo "/sbin/route add " . escapeshellarg($rtent['network']) .
+ " -iface " . escapeshellarg(convert_friendly_interface_to_real_interface_name($rtent['interface']));
+ mwexec("/sbin/route add " . escapeshellarg($rtent['network']) .
+ " -iface " . escapeshellarg(convert_friendly_interface_to_real_interface_name($rtent['interface'])));
+ } else {
+ mwexec("/sbin/route add " . escapeshellarg($rtent['network']) .
+ " " . escapeshellarg($rtent['gateway']));
+ }
/* record route so it can be easily removed later (if necessary) */
fwrite($fd, $rtent['network'] . "\n");
}
OpenPOWER on IntegriCloud