ipv6 fixes for gateway

This commit is contained in:
Eric Schultz
2017-05-13 16:44:01 -05:00
parent c30b8c5d93
commit bd5516d990
2 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -15,7 +15,7 @@ Title="Routing Table"
?>
<?
exec("ls --indicator-style=none /sys/class/net|grep -P '^(eth|br|bond)'",$ports);
exec("ls --indicator-style=none /sys/class/net|grep -P '^(eth|br|bond)'",$defined);
?>
<style>
input.fixed{width:160px;}
@@ -53,7 +53,7 @@ $(routeTable);
Enter route + gateway + metric:
: <input type="text" name="route" maxlength="39" value="" class="fixed" placeholder="IPv4/nn or IPv6/nn route" required>
<input type="text" name="gateway" class="fixed" value="" list="device" placeholder="gateway name or address" required>
<datalist id="device"><?foreach ($ports as $port):?><?echo "<option value='$port'>"?><?endforeach;?></datalist>
<datalist id="device"><?foreach ($defined as $port):?><?echo "<option value='$port'>"?><?endforeach;?></datalist>
<input type="text" name="metric" min="1" max="9999" value="" class="trim" placeholder="1"><em><i class="fa fa-sort-numeric-asc"></i> optional metric (lowest is preferred)</em>
> Enter a valid IPv4 route in the format *nnn.nnn.nnn.nnn/xx*, e.g. *192.168.1.0/24*<br>
+5 -5
View File
@@ -14,14 +14,14 @@
$task = $_POST['task'];
switch ($task) {
case 'delete':
$gateway = $_POST['gateway'];
$route = $_POST['route'];
$gateway =str_replace(' ','-', trim($_POST['gateway']));
$route = trim($_POST['route']);
if ($gateway && $route) exec("/etc/rc.d/rc.inet1 ".escapeshellarg("{$gateway}_{$route}_del"));
break;
case 'Add Route':
$gateway = $_POST['gateway'];
$route = $_POST['route'];
$metric = strlen($_POST['metric']) ? $_POST['metric'] : 1;
$gateway =str_replace(' ','-', trim($_POST['gateway']));
$route = trim($_POST['route']);
$metric = strlen($_POST['metric']) ? trim($_POST['metric']) : 1;
if ($gateway && $route) exec("/etc/rc.d/rc.inet1 ".escapeshellarg("{$gateway}_{$route}_{$metric}_add"));
break;
default: