[pve-devel] [PATCH] add mtu support for manual interfaces

Alexandre Derumier aderumier at odiso.com
Tue Dec 31 09:40:01 CET 2013


tested with classic linux interfaces/bridge and openvswitch interfaces

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 Makefile         |    3 ++-
 debian/conffiles |    1 +
 mtu              |   16 ++++++++++++++++
 3 files changed, 19 insertions(+), 1 deletion(-)
 create mode 100755 mtu

diff --git a/Makefile b/Makefile
index dc15a87..9c8bf64 100644
--- a/Makefile
+++ b/Makefile
@@ -79,7 +79,7 @@ aplupload:
 	scp aplinfo/aplinfo.dat aplinfo.dat.gz aplinfo/aplinfo.dat.asc download1.proxmox.com:/home/ftp/appliances/
 
 .PHONY: install
-install: country.dat vznet.conf vzdump.conf vzdump-hook-script.pl pve-apt.conf pve-repo-ca-certificates.crt
+install: country.dat vznet.conf vzdump.conf vzdump-hook-script.pl pve-apt.conf pve-repo-ca-certificates.crt mtu
 	install -d -m 0700 -o www-data -g www-data ${DESTDIR}/var/log/pveproxy
 	install -D -m 0644 debian/pve.logrotate ${DESTDIR}/etc/logrotate.d/pve
 	install -d ${DESTDIR}/usr/share/${PACKAGE}
@@ -95,6 +95,7 @@ install: country.dat vznet.conf vzdump.conf vzdump-hook-script.pl pve-apt.conf p
 	install -D -m 0644 pve-repo-ca-certificates.crt ${DESTDIR}/etc/apt/pve-repo-ca-certificates.crt
 	install -D -m 0644 vzdump.conf ${DESTDIR}/etc/vzdump.conf
 	install -D -m 0755 vznet.conf ${DESTDIR}/etc/vz/vznet.conf
+	install -D -m 0755 mtu ${DESTDIR}/etc/network/if-up.d/mtu
 	install -m 0644 vzdump-hook-script.pl ${DOCDIR}/examples/vzdump-hook-script.pl
 	install -m 0644 copyright ${DOCDIR}
 	install -m 0644 debian/changelog.Debian ${DOCDIR}
diff --git a/debian/conffiles b/debian/conffiles
index 798e71d..43953c3 100644
--- a/debian/conffiles
+++ b/debian/conffiles
@@ -12,3 +12,4 @@
 /etc/apt/apt.conf.d/75pveconf
 /etc/apt/pve-repo-ca-certificates.crt
 /etc/apt/sources.list.d/pve-enterprise.list
+/etc/network/if-up.d/mtu
diff --git a/mtu b/mtu
new file mode 100755
index 0000000..1369f42
--- /dev/null
+++ b/mtu
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+case "$IFACE" in
+  # Ignore any alias (#272891) which uses <interface>:<alabel>
+  *:*)
+    exit 0
+  ;;
+esac
+
+if [ "$METHOD" != manual ]; then
+        exit 0
+fi
+
+if [ -n "$IF_MTU" ]; then
+    ip link set $IFACE mtu $IF_MTU
+fi
-- 
1.7.10.4




More information about the pve-devel mailing list