1

every time I connect to my VPN, I should run

sudo ifconfig ppp0 mtu 1300

How could I make it permanent?

I'm using Ubuntu 14.04

Mohse Taheri
  • 741
  • 1
  • 6
  • 23

2 Answers2

5

You can make your custom script at this address : /etc/network/if-up.d,

#!/bin/sh

if [ "$IFACE" = "ppp0" ]; then
    sudo ifconfig ppp0 mtu 1300
fi

finally make executable and enjoy from your life ...

Farshad
  • 1,465
  • 1
  • 9
  • 12
1

I've tried to apply Farshad's solution on ubuntu 16, and it wasn't working.

Only small fix was needed there - remove sudo from your script, because everything inside /etc/network/if-up.d/ dir is already run as root user.

#!/bin/sh

if [ "$IFACE" = "ppp0" ]; then
    ifconfig ppp0 mtu 1300
fi
juggernaut
  • 748
  • 1
  • 10
  • 19