I'm trying to run Speedtest CLI on an embedded Linux device using LTE in the US but the upload fails:
Speedtest by Ookla
Server: North Central Telephone Coop - Lafayette, TN (id = 4895)
ISP: Verizon Wireless
Latency: 49.88 ms (6.93 ms jitter)
Download: 9.23 Mbps (data used: 9.8 MB )
Upload: FAILED
[error] Cannot write:
This works fine if I put the same SIM card in a Wifi access point then connect to it, so it's something to do with the setup of the device. But it works fine in other countries with local carriers.
Turns out the problem is that Linux defaults the MTU to 1500 but US mobile carriers prefer a lower value: https://www.digi.com/support/knowledge-base/recommended-mtu-mru-settings-on-cellular-networks
Changing the MTU to 1420 fixed the problem:
Full instructions here: https://linuxhint.com/how-to-change-mtu-size-in-linux/