mirror of
https://github.com/unraid/webgui.git
synced 2026-04-26 12:20:42 -05:00
Added support for user specified network MTU value
This commit is contained in:
@@ -34,6 +34,7 @@ function checkNetworkSettings() {
|
||||
form.DNS_SERVER1.disabled = (form.DHCP_KEEPRESOLV.value != "yes") || disabled;
|
||||
form.DNS_SERVER2.disabled = (form.DHCP_KEEPRESOLV.value != "yes") || disabled;
|
||||
form.DNS_SERVER3.disabled = (form.DHCP_KEEPRESOLV.value != "yes") || disabled;
|
||||
form.MTU.disabled = disabled;
|
||||
}
|
||||
function checkBondingSettings() {
|
||||
var form = document.network_settings;
|
||||
@@ -86,7 +87,7 @@ Setup bridge:
|
||||
> (most consumer switches **do not**).
|
||||
>
|
||||
> Doing so will cause an "ARP broadcast storm" and can bring down your
|
||||
> entire network (unplugging all sever ethernet ports except one
|
||||
> entire network (unplugging all server ethernet ports except one
|
||||
> typically will restore your network).
|
||||
|
||||
Bridge name:
|
||||
@@ -166,6 +167,12 @@ DNS server 3:
|
||||
|
||||
> This is the DNS server to use when DNS Servers 1 and 2 are both down.
|
||||
|
||||
Desired MTU:
|
||||
: <input type="text" name="MTU" maxlength="5" value="<?=$var['MTU'];?>" class="narrow" onchange="checkNetworkSettings()">
|
||||
|
||||
> This is the MTU size to use on all physical Ethernet interfaces participating in the network stack.
|
||||
> If left blank, the MTU will automatically be determined (most likely 1500).
|
||||
|
||||
|
||||
: <input type="submit" name="changeNetwork" value="Apply" <?=$disabled?>><input type="button" value="Done" onclick="done()"><?=$disabled ? "Array must be <strong>Stopped</strong> to change" : ""?>
|
||||
|
||||
|
||||
@@ -160,14 +160,15 @@ case 'port':
|
||||
case 'main':
|
||||
$ports = explode(',',$_POST['ports']); $i = 0;
|
||||
foreach ($ports as $port) {
|
||||
unset($info);
|
||||
$mtu = file_get_contents("/sys/class/net/$port/mtu");
|
||||
if ($port=='bond0') {
|
||||
$ports[$i++] = exec("grep -Pom1 '^Bonding Mode: \K.+' /proc/net/bonding/bond0");
|
||||
$ports[$i++] = exec("grep -Pom1 '^Bonding Mode: \K.+' /proc/net/bonding/bond0").", mtu $mtu";
|
||||
} else if ($port=='lo') {
|
||||
$ports[$i++] = str_replace('yes','loopback',exec("ethtool lo|grep -Pom1 '^\s+Link detected: \K.+'"));
|
||||
} else {
|
||||
exec("ethtool $port|grep -Po '^\s+(Speed|Duplex): \K[^U\\n]+'",$info);
|
||||
$ports[$i++] = $info[0] ? "{$info[0]} - ".strtolower($info[1])." duplex" : "not connected";
|
||||
unset($info);
|
||||
exec("ethtool $port|grep -Po '^\s+(Speed|Duplex|Link\sdetected): \K[^U\\n]+'",$info);
|
||||
$ports[$i++] = (array_pop($info)=='yes' && $info[0]) ? "{$info[0]}, ".strtolower($info[1])." duplex, mtu $mtu" : "not connected";
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -152,13 +152,14 @@ echo "$memory_installed MB (max. installable capacity $memory_maximum GB)".$sta
|
||||
exec("ifconfig -s|grep -Po '^(bond|eth)\d+'",$sPorts);
|
||||
$i = 0;
|
||||
foreach ($sPorts as $port) {
|
||||
$mtu = file_get_contents("/sys/class/net/$port/mtu");
|
||||
if ($i++) echo "<br><span style='width:94px; display:inline-block'> </span>";
|
||||
if ($port=='bond0') {
|
||||
echo "$port: ".exec("grep -Pom1 '^Bonding Mode: \K.+' /proc/net/bonding/bond0");
|
||||
echo "$port: ".exec("grep -Pom1 '^Bonding Mode: \K.+' /proc/net/bonding/bond0").", mtu $mtu";
|
||||
} else {
|
||||
unset($info);
|
||||
exec("ethtool $port|grep -Po '^\s+(Speed|Duplex): \K[^U\\n]+'",$info);
|
||||
echo $info[0] ? "$port: {$info[0]} - {$info[1]} Duplex" : "$port: not connected";
|
||||
exec("ethtool $port|grep -Po '^\s+(Speed|Duplex|Link\sdetected): \K[^U\\n]+'",$info);
|
||||
echo (array_pop($info)=='yes' && $info[0]) ? "$port: {$info[0]}, {$info[1]} Duplex, mtu $mtu" : "$port: not connected";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user