Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 211355 - net-misc/openvpn does not allow to adjust the MTU
Summary: net-misc/openvpn does not allow to adjust the MTU
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Alon Bar-Lev (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-25 11:02 UTC by helge.preuss
Modified: 2008-02-25 18:51 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description helge.preuss 2008-02-25 11:02:15 UTC
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!
Comment 1 Alon Bar-Lev (RETIRED) gentoo-dev 2008-02-25 16:21:23 UTC
Why don't you specify this in the configuration file?
Comment 2 Alon Bar-Lev (RETIRED) gentoo-dev 2008-02-25 16:26:14 UTC
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
Comment 3 helge.preuss 2008-02-25 16:56:13 UTC
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.
Comment 4 helge.preuss 2008-02-25 17:06:31 UTC
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!
Comment 5 Alon Bar-Lev (RETIRED) gentoo-dev 2008-02-25 18:51:00 UTC
.