I'm using Ubuntu 20.04 in WSL2, and cannot for the life of me permanently set the MTU. No matter what I do, after rebooting, it's 1500 again. I had the same problem running Ubuntu natively, and switched to windows because Ubuntu doesn't work over VPN because the MTU is wrong.
Is there really no way to permanently set the MTU?
I tried /etc/dhcp/dhclient.conf
GNU nano 4.8 /etc/dhcp/dhclient.conf # Configuration file for /sbin/dhclient. # # This is a sample configuration file for dhclient. See dhclient.conf's # man page for more information about the syntax of this file # and a more comprehensive list of the parameters understood by # dhclient. # # Normally, if the DHCP server provides reasonable information and does # not leave anything out (like the domain name, for example), then # few changes must be made to this file, if any. # option rfc3442-classless-static-routes code 121 = array of unsigned integer 8; send host-name = gethostname(); default interface-mtu 1340; supersede interface-mtu 1340; request subnet-mask, broadcast-address, time-offset, routers, domain-name, domain-name-servers, domain-search, host-name, dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.sntp-servers, netbios-name-servers, netbios-scope, rfc3442-classless-static-routes, ntp-servers; #send dhcp-client-identifier 1:0:a0:24:ab:fb:9c; #send dhcp-lease-time 3600; #supersede domain-name "fugue.com home.vix.com"; #prepend domain-name-servers 127.0.0.1; #require subnet-mask, domain-name-servers; timeout 300; #retry 60; #reboot 10; #select-timeout 5; #initial-interval 2; #script "/sbin/dhclient-script"; #media "-link0 -link1 -link2", "link0 link1"; #reject 192.33.137.209; #alias { # interface "eth0"; # fixed-address 192.5.5.213; # option subnet-mask 255.255.255.255; #} #lease { # interface "eth0"; # fixed-address 192.33.137.200; # medium "link0 link1"; # option host-name "andare.swiftmedia.com"; # option subnet-mask 255.255.255.0; # option broadcast-address 192.33.137.255; # option routers 192.33.137.250; # option domain-name-servers 127.0.0.1; # renew 2 2000/1/12 00:00:01; # rebind 2 2000/1/12 00:00:01; # expire 2 2000/1/12 00:00:01; #}
I also tried messing with netplan, but I don't think my system uses that.
Also tried /etc/network/interfaces
mtu 1340