Hey is it possible to somehow achieve that the Guest uses a MTU of 1400? For example by forcing the e1000 or virtio network device to use a mtu of 1400? Greetings, Alex
So i Need to do this inside the vm? My Problem is, that i Need to set the mtu to 1400 to get internet Access. However i Cent set the mtu during linux Installation....
you can try to force mtu 1400 on vmbr, but I think you'll have fragmentation if your guest use 1500 at install.
ok, so there is no way to "manipulate" the guest nic (virtio or emulated) to tell the guest that the maximum possible is a mtu of 1400?
seem that qemu 2.8 support a new option for virtio-net : host_mtu=xxx https://git.qemu.org/?p=qemu.git;a=commit;h=a93e599d4a04c3cf7edcf5a24f3397e27431c027 but it's not yet implemented in proxmox
That would be awesome if Proxmox could implement that. The actual use case is Hetzners new vSwitch-Feature where the mtu needs to be 1400. So I am for sure not the only one wanting this feature..
you can try to hack /usr/share/perl5/PVE/QemuServer.pm sub print_netdevice_full { ... $tmpstr .= ",bootindex=$net->{bootindex}" if $net->{bootindex} ; $tmpstr .= ",host_mtu=1400" if $net->{model} eq 'virtio'; then systemctl restart pvedaemon and start your vm.
I would also prefer to implement this option in Proxmox. It worked great with your modification and the Vlans from Hetzner.
Hello there, can anyone help to add this patch to PVE to configure MTU by Network Edit dialog There is only to patches First adds ability to specify in network config parameter ,mtu=MTU_NUM /etc/pve/qemu-server/VMID.conf Code: --- /usr/share/perl5/PVE/QemuServer.pm.orig 2018-08-30 03:07:40.885517605 +0300 +++ /usr/share/perl5/PVE/QemuServer.pm 2018-08-30 02:56:40.191065007 +0300 @@ -715,6 +715,12 @@ description => "Rate limit in mbps (megabytes per second) as floating point number.", optional => 1, }, + mtu => { + type => 'number', + minimum => 1200, maximum=> 9000, + description => "MTU", + optional => 1, + }, tag => { type => 'integer', minimum => 1, maximum => 4094, @@ -1839,6 +1845,7 @@ $tmpstr .= ",vectors=$vectors,mq=on"; } $tmpstr .= ",bootindex=$net->{bootindex}" if $net->{bootindex} ; + $tmpstr .= ",host_mtu=$net->{mtu}" if $net->{mtu} ; if ($use_old_bios_files) { my $romfile; @@ -4634,7 +4641,7 @@ &$safe_string_ne($oldnet->{trunks}, $newnet->{trunks}) || &$safe_num_ne($oldnet->{firewall}, $newnet->{firewall})) { PVE::Network::tap_unplug($iface); - PVE::Network::tap_plug($iface, $newnet->{bridge}, $newnet->{tag}, $newnet->{firewall}, $newnet->{trunks}, $newnet->{rate}); + PVE::Network::tap_plug($iface, $newnet->{bridge}, $newnet->{tag}, $newnet->{firewall}, $newnet->{trunks}, $newnet->{rate}, $newnet->{mtu}); } elsif (&$safe_num_ne($oldnet->{rate}, $newnet->{rate})) { # Rate can be applied on its own but any change above needs to # include the rate in tap_plug since OVS resets everything. Second patch is for GUI to edit MTU settings Code: --- /usr/share/pve-manager/js/pvemanagerlib.js.orig 2018-08-30 03:08:07.430582086 +0300 +++ /usr/share/pve-manager/js/pvemanagerlib.js 2018-08-30 02:37:28.504841119 +0300 @@ -1517,6 +1517,8 @@ res.bridge = match_res[1]; } else if ((match_res = p.match(/^rate=(\d+(\.\d+)?)$/)) !== null) { res.rate = match_res[1]; + } else if ((match_res = p.match(/^mtu=(\d+)$/)) !== null) { + res.mtu = match_res[1]; } else if ((match_res = p.match(/^tag=(\d+(\.\d+)?)$/)) !== null) { res.tag = match_res[1]; } else if ((match_res = p.match(/^firewall=(\d+)$/)) !== null) { @@ -1558,6 +1560,9 @@ if (net.rate) { netstr += ",rate=" + net.rate; } + if (net.mtu) { + netstr += ",mtu=" + net.mtu; + } if (net.queues) { netstr += ",queues=" + net.queues; } @@ -1785,7 +1790,7 @@ if (!p || p.match(/^\s*$/)) { return; // continue } - var match_res = p.match(/^(bridge|hwaddr|mtu|name|ip|ip6|gw|gw6|firewall|tag|rate)=(\S+)$/); + var match_res = p.match(/^(bridge|hwaddr|mtu|name|ip|ip6|gw|gw6|firewall|tag|mtu|rate)=(\S+)$/); if (!match_res) { // todo: simply ignore errors ? return; // continue @@ -18401,6 +18406,12 @@ delete me.network.rate; } + if (values.mtu) { + me.network.mtu = values.mtu; + } else { + delete me.network.mtu; + } + var params = {}; params[me.confid] = PVE.Parser.printQemuNetwork(me.network); @@ -18466,6 +18477,16 @@ xtype: 'proxmoxcheckbox', fieldLabel: gettext('Disconnect'), name: 'disconnect' + }, + { + xtype: 'numberfield', + fieldLabel: gettext('MTU'), + minValue: 1200, + maxValue: 9000, + value: '', + emptyText: '1500', + name: 'mtu', + allowBlank: true } ]; @@ -18484,6 +18505,7 @@ 'firewall', 'model', 'macaddr', + 'mtu', 'rate', 'queues' ]; After that you should restart pvedaemon and pveproxy
@Tacid I'll do some changes if it's ok for you: min-max mtu : 576-65535 only do it for virtio-net (not supported for other model card) hotplug not working, add a check for this remove the mtu param in tap_plug (it's doing nothing and not related to tap)
patches sent: https://pve.proxmox.com/pipermail/pve-devel/2018-August/033555.html https://pve.proxmox.com/pipermail/pve-devel/2018-August/033556.html