Skip to content

Instantly share code, notes, and snippets.

@ontheklaud
Last active July 2, 2020 09:26
Show Gist options
  • Save ontheklaud/9401febf8184a4c44a8e593ebb8f4996 to your computer and use it in GitHub Desktop.
Save ontheklaud/9401febf8184a4c44a8e593ebb8f4996 to your computer and use it in GitHub Desktop.
Change KVM VM's network packet size (MTU)
#! /bin/bash
# Reference(s):
# https://libvirt.org/sources/virshcmdref/html/sect-net-edit.html
# 1. get information of virtual bridge (virbr*)
sudo virsh net-list --all
# 2. edit virbr mtu
sudo virsh net-edit <virbr connection name>
# append or insert the below item next to <bridge ~/>
# <mtu size='9000'/> and :wq
# 3. reboot and change mtu on guest
# 4. get virbr information
ifconfig <virbr*>
# virbr*: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 9000
# 5. get mtu working status
tracepath <host>
# 1?: [LOCALHOST] pmtu 9000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment