Changing MTU size for VPN
August 3, 2021
| By Haluk Dogan
I can't open some websites when I am connected to VPN. Default MTU size was 1500 when interface was up. In order to find the right MTU value, I tried following command:
ping -c 3 -M do -s 1300 stackoverflow.com
1300 worked for me. I modified the MTU size to 1300+28=1328.
emacs -nw /etc/NetworkManager/dispatcher.d/01-ifupdown
#!/bin/sh
#info : pre-up and pre-down are not implemented in network-manager
if [ "$2" = "vpn-up" ]; then
/sbin/ifconfig "$1" mtu 1328
fi
To check if it's updated, you can run ifconfig
and then verify MTU size.
I still needed to change network settings in Firefox. To make that change, follow Firefox -> Settings -> Network Settings -> Auto-detect proxy settings for this network.