From 6a2d533f941b6e52377ec1f3f1c690eef1845550 Mon Sep 17 00:00:00 2001 From: Adam Israel Date: Thu, 27 Apr 2017 20:45:51 -0400 Subject: [PATCH] Auto-detect the MTU on the default interface and use that for the lxd bridge Signed-off-by: Adam Israel Change-Id: If01abbd67fcdc86d0e953f3753bf5c5da1192191 --- jenkins/VCA/start_build | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/jenkins/VCA/start_build b/jenkins/VCA/start_build index 45b0e94c..d6ccfd8c 100755 --- a/jenkins/VCA/start_build +++ b/jenkins/VCA/start_build @@ -56,6 +56,16 @@ EOF systemctl enable lxd-bridge systemctl start lxd-bridge +DEFAULT_INTERFACE=$(route -n | awk '$1~/^0.0.0.0/ {print $8}') +DEFAULT_MTU=$( ip addr show $DEFAULT_INTERFACE | perl -ne 'if (/mtu\s(\d+)/) {print $1;}') + +INFO "Setting lxdbr0 MTU to $DEFAULT_MTU" +ifconfig lxdbr0 mtu $DEFAULT_MTU + +# Make the MTU change persistent between reboots +sed -i '/ifconfig lxdbr0 mtu/d' /etc/rc.local +sed -i "$ i ifconfig lxdbr0 mtu $DEFAULT_MTU" /etc/rc.local + INFO "Pre-caching Ubuntu:16.04 image (this may take several minutes)..." # Setup a daily cron to update the cached image -- 2.25.1