Skip to content

Instantly share code, notes, and snippets.

@Renan-Di
Renan-Di / configure-mtu.sh
Last active October 27, 2022 12:51
Configure mtu inside wsl to avoid conectivity problems when using vpn
#! /bin/bash
mkdir ~/start-scripts
cat <<EOF >> ~/start-scripts/change-mtu.sh
#! /bin/bash
ip link set dev eth0 mtu 1350
EOF
chmod +x ~/start-scripts/change-mtu.sh
echo "sudo ~/start-scripts/change-mtu.sh" >> ~/.bashrc
sudo -i
echo "$USER ALL=NOPASSWD: $HOME/start-scripts/change-mtu.sh" | EDITOR='tee -a' sudo -n -e /etc/sudoers.d/mtu