Our network setup in Germany uses a lower MTU (1400) due to technical reasons. If you're running a VPS in this region, your primary interface MTU will be set automatically. However, Docker containers will not pick up this MTU by default tipically.
There are two options to set the correct MTU. We recommend using option A, it's much easier.
A) Using iptables:
1. You will need to add the following iptables rule:
iptables -t mangle -A POSTROUTING -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 1400
2. To ensure it's still applied after a reboot, you can add a crontab entry with the following command:
(crontab -l ; echo "@reboot /sbin/iptables -t mangle -A POSTROUTING -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 1400 >> /dev/null 2>&1")| sudo crontab -
B) Alternative: Updating the Docker configuration:
1. You will need to edit the file /etc/docker/daemon.json with the following contents:
{
"mtu": 1400
}
Save the file and then run systemctl restart docker to apply this change.
2. For Docker compose files you will need to update the default network (or adjust the existing one) in your docker-compose.yml:
networks:
default:
driver_opts:
com.docker.network.driver.mtu: 1400
3. If you're running Pterodactyl, you will need to update /etc/pterodactyl/config.yml and set mtu to 1400.
You will need to delete the pterodactyl network so that it gets re-created with the correct MTU in the next startup:
- Stop any running servers. Stop wings with systemctl stop wings
- Delete the network with: docker network rm pterodactyl_nw
- Start wings with systemctl start wings