mirror of
https://github.com/unraid/webgui.git
synced 2026-04-22 10:08:25 -05:00
ipv6 fixes for gateway
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user