diff --git a/emhttp/plugins/dynamix/Eth0.page b/emhttp/plugins/dynamix/Eth0.page index 960bdff54..47feb55ae 100644 --- a/emhttp/plugins/dynamix/Eth0.page +++ b/emhttp/plugins/dynamix/Eth0.page @@ -23,6 +23,7 @@ $validIP4 = "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]? $validIP6 = "(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|(:|([0-9a-fA-F]{1,4}:)+):(([0-9a-fA-F]{1,4}:)*[0-9a-fA-F]{1,4})?)"; $enable = _('Enable default gateway'); $metric = _('metric value, a lower value is more preferred'); +$jumbo = _('Enable jumbo frames'); $masks = [ '255.0.0.0' => '8', '255.255.0.0' => '16', '255.255.128.0' => '17', '255.255.192.0' => '18', @@ -209,7 +210,7 @@ function prepareSettings(form) { var i = $(this).prop('name').split(':')[1]; var protocol = $(form).find('select[name="PROTOCOL:'+i+'"]').val() || 'ipv4'; var metric = $(form).find('input[name="METRIC:'+i+'"]').val(); - var gw4 = (port == 'eth0') ? true : $(form).find('input[name="USE_GW:'+i+'"]').prop('checked'); + var gw4 = (port == 'eth0') ? true : $(form).find('input[name="USE_GW4:'+i+'"]').prop('checked'); if (protocol != 'ipv6' && $(this).val() != 'no') { $(form).find('input[name="IPADDR:'+i+'"]').prop('disabled',false).val(''); $(form).find('input[name="GATEWAY:'+i+'"]').prop('disabled',false).val(''); @@ -235,6 +236,8 @@ function prepareSettings(form) { $(form).find('input[name="'+name+'"]').val(data); }); } + // force default MTU if jumbo frames are not enabled + if ($(form).find('input[name="USE_MTU"]').prop('checked') == false) $(form).find('input[name="MTU"]').val(''); $(form).find('input[name="#arg[1]"]').val(arg1[port]); setTimeout(refresh, 25000); return true; @@ -356,6 +359,11 @@ function selectGW(form, prot, index, step) { } } +function selectMTU(form) { + let jumbo = $(form).find('input[name="USE_MTU"]').prop('checked'); + $(form).find('input[name="MTU"]').prop('disabled',!jumbo); +} + function checkNetworkSettings(form, index) { var disabled4 = $(form).find('select[name="USE_DHCP:'+index+'"]').val()!='no'; var disabled6 = $(form).find('select[name="USE_DHCP6:'+index+'"]').val()!='no'; @@ -521,6 +529,7 @@ $(function() { checkNetworkAccess(form); selectProtocol(form); selectGW(form); + selectMTU(form); disableForm(form); $('#bond-eth0').dropdownchecklist('disable'); @@ -757,7 +766,8 @@ _(IPv6 privacy extensions)_: _(Desired MTU)_: -: +: > + > :eth_desired_mtu_help: @@ -797,7 +807,7 @@ _(Network protocol)_:
_(IPv4 address assignment)_: -: @@ -826,7 +836,7 @@ _(IPv4 default gateway)_:
_(IPv6 address assignment)_: -: 0):?> @@ -892,7 +902,7 @@ _(Network protocol)_:
_(IPv4 address assignment)_: -: @@ -915,7 +925,7 @@ _(IPv4 default gateway)_:
_(IPv6 address assignment)_: -: diff --git a/emhttp/plugins/dynamix/EthX.page b/emhttp/plugins/dynamix/EthX.page index 8775be0bf..acaa386a7 100644 --- a/emhttp/plugins/dynamix/EthX.page +++ b/emhttp/plugins/dynamix/EthX.page @@ -58,6 +58,7 @@ $(function() { checkNetworkAccess(form); selectProtocol(form); selectGW(form); + selectMTU(form); $('div.slave-ethX').hide(); disableForm(form); @@ -165,7 +166,7 @@ _(Network protocol)_:
_(IPv4 address assignment)_: -: @@ -194,7 +195,7 @@ _(IPv4 default gateway)_:
_(IPv6 address assignment)_: -: @@ -230,7 +231,8 @@ _(IPv6 privacy extensions)_:
_(Desired MTU)_: -: +: > + > :eth_desired_mtu_help: @@ -271,7 +273,7 @@ _(Network protocol)_:
_(IPv4 address assignment)_: -: @@ -300,7 +302,7 @@ _(IPv4 default gateway)_:
_(IPv6 address assignment)_: -: @@ -365,7 +367,7 @@ _(Network protocol)_:
_(IPv4 address assignment)_: -: @@ -388,7 +390,7 @@ _(IPv4 default gateway)_:
_(IPv6 address assignment)_: -: diff --git a/emhttp/plugins/dynamix/sheets/Eth0.css b/emhttp/plugins/dynamix/sheets/Eth0.css index 190d92c0d..c95569ff9 100644 --- a/emhttp/plugins/dynamix/sheets/Eth0.css +++ b/emhttp/plugins/dynamix/sheets/Eth0.css @@ -11,4 +11,5 @@ div.shade-gray{background-color:#121510;margin-top:10px;padding:8px 0 3px 0} select.slim{min-width:47px;margin-left:4px} input.slim{width:32px;margin-left:8px} input[type=text].narrow{display:inline;font-size:1.3rem;background-color:transparent;text-indent:0;height:auto;min-height:2rem;line-height:2rem;outline:none;margin:0 20px 0 0;box-shadow:none;border-radius:0;-webkit-transition:none;transition:none} -.hide{display:none} \ No newline at end of file +.hide{display:none} +select.ctrl{margin-right:20px} \ No newline at end of file diff --git a/sbin/create_network_ini b/sbin/create_network_ini index 7bb80a20b..afe6c39e1 100755 --- a/sbin/create_network_ini +++ b/sbin/create_network_ini @@ -159,6 +159,7 @@ for ((i=0; i<${SYSNICS:-1}; i++)); do echo "METRIC6:0=\"${METRIC6[$i]}\"" >>$INI echo "PRIVACY6:0=\"\"" >>$INI fi + echo "USE_MTU=\"${USE_MTU[$i]}\"" >>$INI echo "MTU=\"${MTU[$i]}\"" >>$INI if [[ -n ${VLANS[$i]} ]]; then # process VLAN interfaces