From 1bf3787179381beda7c7cdbb1d19e0b61dff8cf4 Mon Sep 17 00:00:00 2001 From: Mike Hix Date: Wed, 25 Mar 2020 13:31:51 -0700 Subject: [PATCH 1/2] Set the MTU on tap interfaces --- lib/ioh-tap | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ioh-tap b/lib/ioh-tap index ba827ab..dac4c83 100644 --- a/lib/ioh-tap +++ b/lib/ioh-tap @@ -46,9 +46,13 @@ __tap_setup() { fi if [ -n "$tap" ] && [ "$tap" != "-" ] && [ -n "$bridgeif" ]; then local tapif="$(ifconfig -l | tr ' ' '\n' | grep -F -w $tap)" + local mtu="$(ifconfig $bridgeif | egrep -io 'mtu [0-9]+' | cut -d ' ' -f 2)" if [ -z "$tapif" ]; then # create tap interface ifconfig $tap create descr "iohyve-$name-$iface" + if [ -n "$mtu" ] ; then + ifconifg $tap mtu $mtu + fi ifconfig $bridgeif addm $tap fi fi From c22986be4144d87bff916a805274af09fed0b5e5 Mon Sep 17 00:00:00 2001 From: Mike Hix Date: Wed, 25 Mar 2020 13:42:42 -0700 Subject: [PATCH 2/2] Whitespace fix --- lib/ioh-tap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ioh-tap b/lib/ioh-tap index dac4c83..03ddd7e 100644 --- a/lib/ioh-tap +++ b/lib/ioh-tap @@ -50,7 +50,7 @@ __tap_setup() { if [ -z "$tapif" ]; then # create tap interface ifconfig $tap create descr "iohyve-$name-$iface" - if [ -n "$mtu" ] ; then + if [ -n "$mtu" ]; then ifconifg $tap mtu $mtu fi ifconfig $bridgeif addm $tap