libnetwork icon indicating copy to clipboard operation
libnetwork copied to clipboard

MTU option for macvlan driver

Open eugenepark1 opened this issue 6 years ago • 4 comments

"docker network create -d macvlan -o com.docker.network.driver.mtu=1450 " is not honored.

The option to change MTU for macvlan is implemented with a different option (if so, what is it?) or is this feature not available?

eugenepark1 avatar Oct 01 '18 08:10 eugenepark1

Same problem here, i took a quick look at the source and sadly it is not implemented for macvlan.

My workaround is to give the container cap net_admin and set the mtu inside of the container.

H4R0 avatar Sep 19 '20 18:09 H4R0

Another workaround might be manually setting the MTU on the sub-interface

sudo ip link set dev ens4.40 mtu 1500

ericslandry avatar Jul 04 '22 15:07 ericslandry

I understand that this is bridge driver option not macvlan driver option. https://docs.docker.com/engine/reference/commandline/network_create/#bridge-driver-options For my testing, every option described in here only worked for bridge.

yananet avatar Mar 14 '23 00:03 yananet

Any update on this? Currently have this issue and do similar to https://github.com/moby/libnetwork/issues/2274#issuecomment-695339465 or https://github.com/moby/libnetwork/issues/2274#issuecomment-1173926870

@H4R0 did you ever find a way to automate this behavior?

Edit. For now I just fix issues by running a script on system startup instead of allowing docker to restart containers on its own.

voc0der avatar Nov 01 '23 14:11 voc0der