so I found how to fix it.
if nothing seems to work, there may be a solution : lower the MTU
base value is given by ip addr show
giving that the interface you’re using is eth0 :
sudo ip link set dev eth0 mtu 1400
and then try a simple mongosh or mongoexport to test if it works. lower until you can connect.
to set it permanently :
- if you’re using ifupdown :
sudo nano /etc/network/interfaces(or a specific interface in/etc/network/interfaces.d/)
Edit the part of your interface (here eth0) by adding the mtu value that works :
then doiface eth0 inet static mtu 1400sudo systemctl restart networkingorsudo /etc/init.d/networking restart - if you’re using systemd-networkd :
Find or create the.networkfile for your interface in/etc/systemd/network/. The file name and location might vary, but a common pattern is10-eth0.networkfor an interface namedeth0
edit the file, for example with eth0 :
then do[Match] Name=eth0 [Link] MTUBytes=1400sudo systemctl daemon-reload && sudo systemctl restart systemd-networkd - for docker :
Docker have its own config. the best way to change that is by doing :
sudo nano /etc/docker/daemon.json
Edit the file by adding the MTU config (keep it formatted as a JSON)
Then restart docker with{ "mtu": 1400 }sudo systemctl restart docker