I am in the unlucky position that I have to adjust the TUN device MTU for OpenVPN to work with the combination of my system and my router and the OpenVPN server. /usr/sbin/openvpn itself allows this, but there is no way to supply the --tun-mtu to the openvpn initscript, short of hacking /etc/init.d/openvpn itself. That, of course, is an unlucky solution. Reproducible: Always Steps to Reproduce: 1. Find a combination of router and server that needs the MTU to be changed (this should be the hard part! ;-) 2. Send or receive a big chunk of data over the link (e.g. do a ls -alR if you're logged in via ssh) 3. Watch the connection freeze after a couple hundreds of bytes transferred. 4. Scratch your head, try a lot of things, go crazy, annoy the server's admins, you know, that sort of things, until you find out that you actually need to change the --tun-mtu argument to openvpn and that /etc/conf.d/openvpn and /etc/init.d/openvpn do not allow this. 5. Hack /etc/init.d/openvpn: add the line args="${args} --tun-mtu 1256" after line 75. 6. Give in to the nagging feeling that this could be handled better and file a bug report. In an ideal world, I would expect /etc/conf.d/openvpn to have a documented parameter that allows to change the tunnel MTU (and maybe other parameters! Who knows what else can go wrong? I am not a VPN expert at all...). I am asking you to create that ideal world for me. TIA!
Why don't you specify this in the configuration file?
You can also use baselayout in order to do so. At /etc/conf.d/net: tuntap_tun1="tun" mtu_tun1="1256" config_tun1="null" # ln -s net.lo /etc/init.d/net.tun1 # /etc/init.d/net.tun1 start
As far as I can see, this option can not be supplied via the OpenVPN config file, only as command line parameter. As for the baselayout solution, I tried it and it does not work. openvpn ignores the values in /etc/conf.d/net and substitutes its own (1500), even if you have started your tunnel device with a different MTU before starting openvpn. If it /would/ work, it would have the additional drawback that you'd have to start net.tunX before openvpn.
Oops, my bad. Apparently all command line parameters to openvpn can be written to openvpn.conf. tun-mtu 1256 in the openvpn.conf works fine. Forget about this and have a nice day!
.