Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm starting a VPN connection using Network Manager. Once the connection is established I have to change MTU in order it to work properly. For example:

sudo ifconfig ppp0 mtu 777

It is very annoying to execute this command every time I open a VPN connection. Is there any idea to create a script that would execute this command automatically once the connection is established (ppp0 interface is up)?

share|improve this question
up vote 7 down vote accepted

Create a script in /etc/network/if-up.d, containing

#!/bin/sh

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

and make it executable.

share|improve this answer
    
Thank you. It works! – Andreas Sep 10 '11 at 8:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.