Docker network mtu

ElectricEel-24.10.0.2

Does anybody know how to update the mtu on docker0 network interface?

Updating this file; /etc/docker/daemon.json with “mtu” : 1234
Does not work, as this file is over written during a reboot.

Something along the lines of sysctl or init script maybe?

Thank you.
Chris.

Why do you need that?
Some VPN?

For the file, you can always add a bind to a file in TN that can be set read-only.

To answer your question;
I have some docker containers that perform better with higher MTUS.

Sorry what is a bind to a file? I am not familiar with that, can you please shed, provide more details.

Thank you.

Google has the answer, but here it is:

volumes:
- type: bind
source: ./file-in-truenas.log
target: /var/tmp/file-inside-the-container.log
read_only: true

I have to ask again, what kind of containers you use this for?
And you do have to change the MTU of the physical eth interface right?

(Guessing for big data moves like backups? But with modern CPUs, the difference is not that much, so I would like to know how much better the mtu change does in your case?).

Thanks for this, unfortunately this is not what I am looking for.

In this file,
/etc/docker/daemon.json, you can put “mtu”:1234
or you can start docker with
/usr/bin/dockerd --mtu=1234 -H fd:// --containerd=/run/containerd/containerd.sock

if I put the entry in the file, it is overridden on a reboot.
I could do this;
systemctl edit docker.service

But was trying to see if there is a better option where I can configure it via advanced system settings or something like that, then it becomes part of true nas config as opposed to burying like that.

That does not seem to work for me…

I came from here:

because my OpenSpeedTest docker container does not reach full speed with 10gbits.

i tried to set MTU for vb-docker in Network settings, but seems like there are two of those… docker Network interfaces.

root@NAS[/lib/systemd/system]# ip a | grep mtu
3329: vethfd0996c@if3328: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc noqueue master br-e78bd1299d8e state UP group default
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 xdpgeneric/id:5209 qdisc noqueue state UNKNOWN group default qlen 1000
2: enp6s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq master br1 state DOWN group default qlen 1000
3: enp7s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq master br1 state DOWN group default qlen 1000
4: enp8s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc mq master br1 state UP group default qlen 1000
5: br1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc noqueue state UP group default qlen 1000
8: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br1 state UNKNOWN group default qlen 1000
.......
3198: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
..........
133: vb-docker@if2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc noqueue state UP group default qlen 1000
........

Still stuck at 1500 instead of 9000