This forces the interface of a newly created interface of a
KVM instance to be the same as that of the bridge.  On RHEL5
and RHEL6, the MTU for the bridge interface will be set to the
lowest MTU of its constituents.  If the newly created tap interface
has an MTU of 1500 and the bridge has an MTU of 9000, the bridge
MTU will be lowered to 1500.  Inside the instance, you will be
unable to transmit 9k packets out the supposedly jumbo-packet-capable
interface.  By setting the MTU of the tap interface to the same
as the bridge before adding it, I can transmit 9k packets from
the instance off the bridge.
---
 tools/kvm-ifup.in |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tools/kvm-ifup.in b/tools/kvm-ifup.in
index 370040c..a53261a 100644
--- a/tools/kvm-ifup.in
+++ b/tools/kvm-ifup.in
@@ -35,6 +35,10 @@ fi
 ip link set $INTERFACE up
 
 if [ "$MODE" = "bridged" ]; then
+       # Set interface MTU to same as bridge
+       MTU=$(ip link show dev $BRIDGE | grep -w 'mtu' | awk '{print $5}')
+       ip link set $INTERFACE mtu $MTU
+
        # Connect the interface to the bridge
        brctl addif $BRIDGE $INTERFACE
 else
-- 
1.7.4.4

Reply via email to