PDA

View Full Version : OpenVPN for TiVo HD



Thinkdiff
03-02-2011, 02:05 AM
Here's my current work on OpenVPN for the TiVo HD. It should be possible to run it on any TiVo, you just have to recompile the appropriate kernel with CONFIG_TUN=y. For some reason, the TiVo crashed when the tun/tap driver was compiled as a module.

OpenVPN and supporting libraries were compiled cleanly using the latest mips-TiVo-linux toolchain.

Here's the ReadMe:

OpenVPN client for TiVo OS - TiVo HD
-------------------------------------------------
| |
| Compiled by Thinkdiff on dealdatabase.com |
| Kernel configuration and build script by Jamie|
| |
-------------------------------------------------


1. Files
2. Installation
3. Kernel Modifications and OpenVPN Usage

----------
1. Files |
----------

Binary/
bcmenet.o
- replacement library required for netopt kernel
openvpn
- OpenVPN 2.2-b5 Binary
openvpn_libs.tgz
- Libraries Used to build OpenVPN (Read #2 Below)
vmlinux-Gen06-openvpn.px
- TiVo 9.4.1 Kernel with OpenVPN enabled (More Info in #3)
Sources/
config-Gen06-openvpn
- Config file used to build kernel from Linux-2.4.20 sources
Source_Read_Me.txt
- Instructions for building the binaries provided

-----------------
2. Installation |
-----------------

Copy the Binary folder to your TiVo. For these instructions, I will assume
the files are in /var/hack/openvpn. Perform the following commands:

mount -o remount,rw /
cd /lib
tar xzf /var/hack/openvpn/openvpn_libs.tgz
cd /platform/lib/modules
mv bcmenet.o bcmenet.orig
cp /var/hack/openvpn/bcmenet.o bcmenet.o
cd /var/hack/openvpn/
dd if=/dev/hdaX of=vmlinux_backup.px
dd if=vmlinux-Gen06-openvpn.px of=/dev/hdaX
** REPLACE hdaX WITH YOUR KERNEL PARTITION **
reboot

Note: The openvpn_libs may not be required. You are welcome to try to run the
openvpn binary without the libs installed. It seems to work on my TiVo, so it
may work on yours as well.

-------------------------------------------
3. Kernel Modifications and OpenVPN Usage |
-------------------------------------------

The included kernel is an extension of Jamie's netopt-ext3 kernel based on the kernel
sources provided by TiVo for the 9.4.1 OS. It will work on 9.x and 11.x. In addition to
patches included by Jamie, it also has support for Bridges (via brctl) and TUN/TAP
devices.

The OpenVPN command works the same way it would on any other platform. Configuration
of OpenVPN is your own responsibility.

djl
03-03-2011, 08:08 PM
Thanks for this. Does this also include the tweak to /proc/sys/net/core/rmem_* that you mentioned in your earlier thread?


Here's my current work on OpenVPN for the TiVo HD. It should be possible to run it on any TiVo, you just have to recompile the appropriate kernel with CONFIG_TUN=y. For some reason, the TiVo crashed when the tun/tap driver was compiled as a module.

OpenVPN and supporting libraries were compiled cleanly using the latest mips-TiVo-linux toolchain.

Thinkdiff
03-03-2011, 08:17 PM
No. I decided to manually run the following command every start-up to set the Receive Win. Compiling the kernel with the default values modified gave some odd results.


echo "4096 262144 4194304" > /proc/sys/net/ipv4/tcp_rmem

That fixes the throughput on all long distance (~100ms) transfers.

tivo4mevo
03-06-2011, 04:55 PM
Quite cool. Put it all together and was able to browse a remote unit's playlist.

Thanks for the openvpn mips executable, Thinkdiff. The library archives (*.a) appear to be statically linked into it, so they aren't required for execution.

I've attached a Series2 kernel (Jamie's config with tun/tap and brctl support) suitable for use with older units.