From fef3a8efd27f40aa8663e0eb5eed8b8b45d6e77a Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sat, 18 Mar 2006 20:51:06 +0000 Subject: 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. --- usr/local/www/system_routes.php | 8 +++++++- usr/local/www/system_routes_edit.php | 34 ++++++++++++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 3 deletions(-) (limited to 'usr/local') diff --git a/usr/local/www/system_routes.php b/usr/local/www/system_routes.php index 2edde7a..90479a6 100755 --- a/usr/local/www/system_routes.php +++ b/usr/local/www/system_routes.php @@ -132,7 +132,13 @@ include("head.inc"); - +   diff --git a/usr/local/www/system_routes_edit.php b/usr/local/www/system_routes_edit.php index 389d242..ab14ae9 100755 --- a/usr/local/www/system_routes_edit.php +++ b/usr/local/www/system_routes_edit.php @@ -47,6 +47,7 @@ if (isset($id) && $a_routes[$id]) { explode('/', $a_routes[$id]['network']); $pconfig['gateway'] = $a_routes[$id]['gateway']; $pconfig['descr'] = $a_routes[$id]['descr']; + $pconfig['interfacegateway'] = isset($a_routes[$id]['interfacegateway']); } if ($_POST) { @@ -55,8 +56,13 @@ if ($_POST) { $pconfig = $_POST; /* input validation */ - $reqdfields = explode(" ", "interface network network_subnet gateway"); - $reqdfieldsn = explode(",", "Interface,Destination network,Destination network bit count,Gateway"); + if($_POST['interfacegateway']) { + $reqdfields = explode(" ", "interface network network_subnet"); + $reqdfieldsn = explode(",", "Interface,Destination network,Destination network bit count"); + } else { + $reqdfields = explode(" ", "interface network network_subnet gateway"); + $reqdfieldsn = explode(",", "Interface,Destination network,Destination network bit count,Gateway"); + } do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); @@ -88,6 +94,12 @@ if ($_POST) { $route['network'] = $osn; $route['gateway'] = $_POST['gateway']; $route['descr'] = $_POST['descr']; + + /* use interface as gateway */ + if($_POST['interfacegateway']) + $route['interfacegateway'] = true; + else + unset($route['interfacegateway']); if (isset($id) && $a_routes[$id]) $a_routes[$id] = $route; @@ -108,6 +120,15 @@ include("head.inc"); ?> + @@ -146,6 +167,12 @@ include("head.inc");
Destination network for this static route + Use Interface as gateway + + > +
Check this option to direct all traffic for the destination network out the interface. This is useful for routing DNS traffic out correct interfaces, etc. + + Gateway @@ -170,5 +197,8 @@ include("head.inc"); + -- cgit v1.1