Set MTU on Guest

Discussion in 'Proxmox VE: Networking and Firewall' started by re-host.eu, Jul 3, 2018.

  1. re-host.eu

    re-host.eu New Member

    Joined:
    Oct 3, 2017
    Messages:
    27
    Likes Received:
    0
    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
     
  2. dietmar

    dietmar Proxmox Staff Member
    Staff Member

    Joined:
    Apr 28, 2005
    Messages:
    16,055
    Likes Received:
    257
    That is a guest setting (you set that inside the guest network stack).
     
  3. re-host.eu

    re-host.eu New Member

    Joined:
    Oct 3, 2017
    Messages:
    27
    Likes Received:
    0
    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....
     
  4. spirit

    spirit Well-Known Member
    Proxmox VE Subscriber

    Joined:
    Apr 2, 2010
    Messages:
    3,066
    Likes Received:
    91
    you can try to force mtu 1400 on vmbr, but I think you'll have fragmentation if your guest use 1500 at install.
     
  5. re-host.eu

    re-host.eu New Member

    Joined:
    Oct 3, 2017
    Messages:
    27
    Likes Received:
    0
    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?
     
  6. spirit

    spirit Well-Known Member
    Proxmox VE Subscriber

    Joined:
    Apr 2, 2010
    Messages:
    3,066
    Likes Received:
    91
    re-host.eu likes this.
  7. re-host.eu

    re-host.eu New Member

    Joined:
    Oct 3, 2017
    Messages:
    27
    Likes Received:
    0
  8. spirit

    spirit Well-Known Member
    Proxmox VE Subscriber

    Joined:
    Apr 2, 2010
    Messages:
    3,066
    Likes Received:
    91
    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.
     
    re-host.eu likes this.
  9. re-host.eu

    re-host.eu New Member

    Joined:
    Oct 3, 2017
    Messages:
    27
    Likes Received:
    0
    I will try out
     
  10. re-host.eu

    re-host.eu New Member

    Joined:
    Oct 3, 2017
    Messages:
    27
    Likes Received:
    0
    @dietmar would it be possible to implement "the hack" in to the official release?
     
  11. aderumier

    aderumier Member

    Joined:
    May 14, 2013
    Messages:
    203
    Likes Received:
    18
    does it work for you ? (I don't have tested it)
     
  12. re-host.eu

    re-host.eu New Member

    Joined:
    Oct 3, 2017
    Messages:
    27
    Likes Received:
    0
    Yes, for me it is working
     
  13. re-host.eu

    re-host.eu New Member

    Joined:
    Oct 3, 2017
    Messages:
    27
    Likes Received:
    0
  14. bfal

    bfal New Member

    Joined:
    Sep 28, 2009
    Messages:
    7
    Likes Received:
    1
    I would also prefer to implement this option in Proxmox. It worked great with your modification and the Vlans from Hetzner.
     
    re-host.eu likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice