Try the same command but with sudo
at the beginning. Remember that you need to do this in the ProxyVM, not the AppVM itself.
This iptables rule will make other AppVMs use the MTU set in the ProxyVM.
If the interface use MTU 1280 (for example) then it will use that on every single VMs. Just try it by going to https://browserleaks.com/ip and see if âMTUâ is set to the correct one.
If itâs close to the one youâve set in the ProxyVM, it means itâs fine.
If you want a certain MTU size, youâll have to set that to the ProxyVM interface (eth0).
I guess your sys-firewall is disposable, so youâll lose everything each reboot. You can put a new AppVM in front of the firewall, put that iptables rule in /rw/config/rc.local
and set the other VMs to use it instead of sys-firewall. Thatâs the easiest workaround.
If itâs not disposable, then you can put everything you need in /rw/config/rc.local, it should persist between reboots. You can make another script and call it from there or you can just paste the commands inside it and it will be executed each time the VM comes up.
After running this command (sudo iptables -t nat -I POSTROUTING -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu), I am still getting new vif#.#s show up, and they are all at 1500 for the MTU, and eth0 is at 1000.
@DVM @unman this didnât work at all.
@Sven iâve seen you post a lot of smart things. this is stumping me, and itâs either stumping everyone else who has replied or I am not implementing what they are saying correctly
@renehoj @Emily @deeplow does anyone know what to do here? hope itâs okay iâm mentioning some people on here who i have seen post some smart things
i am probably not implementing this correctly, but I thought I followed unmanâs instructions. Iâve tried other things. Itâs a real annoyance having to set the MTU each time for multiple vifs.
Please help me.
Setting these manual MTUs each time I connect is hell.
Unman, this is the original poster. Can you please help me? Iâm almost certain I am doing something wrong, but I donât know what. I created the script, I put it in the directory you specified. I thought it worked at first, but itâs not working now.
Can you create a qube and test your script with an MTU value of 1000 and then restart it, then connect multiple vif interfaces (through different networking qubes), and then see if you are getting new vifs with an MTU value of 1000?
Iâm sorry to bother you and everyone who I have asked for help in this thread. I wish I were more skilled and this were easy for me to understand or implement on my own.
I put this in rw/config/rc.local and rw/config/network-hook.d as set_mtu.sh and made it executable and readable and writable by all in both places. Nothing is changing.
The iptables rule is not supposed to change the MTU values of all interface, itâs a rule that change the MTU on the fly. Like I told you, if your MTU is changed while checking online, then it means itâs working.
edited since reply did not show as reply
the previous response didnât show as a reply
I know that when my MTU isnât low enough, my connection is very slow and whonix has more failed circuits, likely due to higher packet loss.
Because I am going through a VPN on a router that uses Wireguard before I use additional networking qubes to change IPs for SEO, the website is going to see the MTU of the lowest VPN, so if I connect, this isnât a realistic way of testing to see if this has had an effect.
Are you saying if I run this command or create a script in rc.local that it will automatically change the MTU âon the flyâ and so nothing will be running at 1500?
I could do this, but when I ran the other script in rc.local that @unman had created, it didnât affect any of the vif interfaces after the reboot. I still donât understand why unmanâs script didnât work. I would much rather be able to type ifconfig and see that the vif MTUs are all at the value I want rather than relying on third-party website testing.
So itâs interesting⌠I have to wait until the vif interaces show up. But then once they show up, if I run systemctl start set_mtu.service, it changes every vif listed. It saves me time.
I wish there was a way to restart this command whenever there is a new vif interface connection.
Make a cron job that checks for new vifs and runs the script if necessary.
Youâre genius.
Itâs finally done.
It may have been the systemctl service before that had changed a vif, and not unmanâs script, which ended up not working. I still donât know why the script from @unman
didnât work.
iâm using the service, using cron. It doesnât make sense because the service is supposed to already change things on the fly, but if it works, it works!
(Solution!)
Iâm having a hard time implementing it in whonix. I did post about MTU on the whonix forum and was told by Patrick to find out elsewhere.
Can I do this in the whonix gw template?
If you donât have ICMP blocked before sys-whonix (in your router/vpn/networking qubes) then you can try to fix MTU issue in sys-whonix with this command:
sudo iptables -I INPUT -p icmp --icmp-type fragmentation-needed -m state --state RELATED -j ACCEPT
Tor is not yet fully bootstrapped. 30 % done - KVM - Whonix Forum
This did not work.
Can I use the same strategy by going into the whonix-gw template and creating the same set_mtu.sh files?
Yes, it should work.