[pve-devel] [PATCH manager 1/2] fix #3719: gui: expose MTU option for containers in web UI

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Oct 19 07:49:03 CEST 2022

the implementation looks mostly OK and works, but some comments on limits and
also a workflow nit that require a v2

high level: The CT implementation currently doesn't checks limits like
qemu-server does, like setting (most of the time) bogus values <576 (see below)
and guaranteed not working values like > $bridge_mtu.

So I'd also add the overall limit of 2^16-1 there as upper limit in the schema
and also assert <= $bridge_mtu on CT-start/veth-hotplug and possibly also on
config change (to early catch it for stopped CTs already, as IMO its better to
push the user towards setting the bridge MTU earlier than the ones of its
connected ports.

work flow nit: why bother adding this to the non advanced section only to move
it immediately? I'd directly add it to advancedColumn1, if you want to move out
rate limit field before or after is 

Am 17/10/2022 um 15:56 schrieb Daniel Tschlatscher:> The option to set the mtu parameter for lxc containers already exists
> in the backend. It only had to be exposed in the web UI as well.
> Signed-off-by: Daniel Tschlatscher <d.tschlatscher at proxmox.com>
> ---
>  www/manager6/lxc/Network.js | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> diff --git a/www/manager6/lxc/Network.js b/www/manager6/lxc/Network.js
> index 7b6437c5..d6a35a49 100644
> --- a/www/manager6/lxc/Network.js
> +++ b/www/manager6/lxc/Network.js
> @@ -138,6 +138,14 @@ Ext.define('PVE.lxc.NetworkInputPanel', {
>  		name: 'firewall',
>  		value: cdata.firewall,
>  	    },
> +	    {
> +		xtype: 'proxmoxintegerfield',
> +		fieldLabel: gettext('MTU'),

wouldn't gettext that, this is a technical abbreviation that is known widely
enough to be language agnostic.

> +		name: 'mtu',
> +		value: cdata.mtu,
needs an emptyText with the default behavior if not set, something like:
"Same as Bridge" 

> +		minValue: 64,

IP requires that hosts must be able to process IP datagrams of at least 576
bytes (for IPv4) or 1280 bytes (for IPv6).

And while yes, one may use something different than IP for sending ethernet
link stuff it seems rather unlikely in practice, so maybe go for 576 as min, if
someone complains we can still lower that and then have an actual known use

The backend can stay at 64 for now, as there we would need to wait for the next
major release with a check for < 576 added to the pve7to8 upgrade helper
script, as long as the frontend is restrictive from the beginning I think there
won't be many cases that run into this check though.

More information about the pve-devel mailing list