= OpenVPN-devel package for OpenWrt = OpenWrt is a very small Linux distribution for routers, initially the Cisco/Linksys "WRT 54 GL", thus the name. !OpenWrt (stable) comes with an OpenVPN package based on the mainstream 2.1 release (as of 2010/06/27). Update: 2014/02/23: Latest unstable (trunk) release of OpenWRT includes OpenVPN 2.3.2. IPv6 support is included. The below documentation is obsolete because there is no openvpn-devel package anymore. If you want IPv6 support or any of the other features in the development tree, you have to build your own package, based on the openvpn-devel sources. Given that !OpenWrt packages are not for standard i386/amd64 CPUs but usually some sort of MIPS system, you need a cross-compilation environment and special tools - but that's all already provided by the !OpenWrt folks, so you just need to add a few bits to add your own package. Update: 2010/08/03: there is an openvpn-devel package in the official OpenWrt package tree. So far it's not available as binary, so this document explains how to checkout the source tree and build from there. = how to build = 1. get the !OpenWrt source tree from !OpenWrt SVN (do this on a Linux system, as a normal user, no root permissions needed) - this is for !OpenWrt 10.03 ("backfire"), adapt for other branches as needed: {{{ svn co svn://svn.openwrt.org/openwrt/branches/backfire/ }}} 2. get the !OpenWrt package tree from SVN and "install" (put all the symlinks where they are needed): {{{ cd backfire ./scripts/feeds update ./scripts/feeds install -a }}} 3. check that the openvpn-devel version that is included is the one that you want to build {{{ backfire$ cd package/feeds/packages/openvpn-devel backfire/package/feeds/packages/openvpn-devel$ grep ^PKG_VERSION Makefile PKG_VERSION:=201026 }}} this number is the "week 26 of the year 2010", which is the tarball that we're building from. If you change that, do not forget to update the PKG_MD5SUM line in the Makefile, otherwise building will fail (checksum error). If you're lazy, just remove the PKG_MD5SUM line (this will disable checksumming the downloaded tar archive). 4. go back to the top level directory and run the config scripts: {{{ backfire/package/feeds/packages/openvpn-devel$ cd ../../../.. backfire$ make defconfig backfire$ make menuconfig }}} * in the "Target System" menu, select the correct !OpenWrt version for your hardware (check the openwrt.net pages for your router type, one example would be "TP-Link TL1043ND -> ar71xx -> Atheros AR71xx/AR7240/AR913x"). Since we do not want to build a bootable !OpenWrt itself, just an !OpenWrt package, it's not important to get this 100% right - having the right CPU version (ar71xx in this example) is what counts. The output of "opkg install $somepackage" on your !OpenWrt installation will tell you the architecture type, in the .ipk file name. * go to "Network" -> "VPN" and check "openvpn-devel" (prerequisites like lzo and zlib will be autoselected) * then "exit" -> "exit" -> "exit" -> "save config -> yes" 5. run "make" and wait... - this will take a long time, building the C compiler (for cross-building to MIPS cpu) and the target system's C library etc. first. {{{ backfire$ make make[1] world make[2] target/compile make[3] -C target/linux compile ... make[3] -C feeds/packages/libs/lzo compile make[3] -C package/iptables compile make[3] -C package/opkg compile make[3] -C package/firewall compile make[3] -C package/crda compile make[3] -C package/hostapd compile make[3] -C feeds/packages/net/openvpn-devel compile <<<<< :-) ... make[3] package/preconfig make[2] target/install make[3] -C target/linux install make[2] package/index backfire$ }}} 6. now you have an openvpn-devel package in ./bin/ar71xx/packages/ {{{ backfire$ ls -l bin/ar71xx/packages/ ... -rw-r--r-- 1 gert users 182075 27. Jun 16:03 openvpn-devel_201026-1_ar71xx.ipk ... }}} = Installing the package = Login to your !OpenWrt router, ftp/wget the package to /tmp, and run "opkg install": {{{ root@OpenWrt:/tmp# opkg update Downloading http://downloads.openwrt.org/backfire/10.03/ar71xx/packages/Packages.gz. Inflating http://downloads.openwrt.org/backfire/10.03/ar71xx/packages/Packages.gz. Updated list of available packages in /var/opkg-lists/packages. root@openwrt:/tmp# wget http:/openvpn-devel_201026-1_ar71xx.ipk ... root@openwrt:/tmp$ opkg install openvpn*ipk Installing openvpn_devel (201026-1) to root... Installing kmod-tun (2.6.32.10-1) to root... Downloading http://downloads.openwrt.org/backfire/10.03/ar71xx/packages/kmod-tun_2.6.32.10-1_ar71xx.ipk. Installing kmod-ipv6 (2.6.32.10-1) to root... Downloading http://downloads.openwrt.org/backfire/10.03/ar71xx/packages/kmod-ipv6_2.6.32.10-1_ar71xx.ipk. Installing libopenssl (0.9.8m-3) to root... Downloading http://downloads.openwrt.org/backfire/10.03/ar71xx/packages/libopenssl_0.9.8m-3_ar71xx.ipk. Installing zlib (1.2.3-5) to root... Downloading http://downloads.openwrt.org/backfire/10.03/ar71xx/packages/zlib_1.2.3-5_ar71xx.ipk. Installing liblzo (2.03-3) to root... Downloading http://downloads.openwrt.org/backfire/10.03/ar71xx/packages/liblzo_2.03-3_ar71xx.ipk. Installing ip (2.6.29-1-2) to root... Downloading http://downloads.openwrt.org/backfire/10.03/ar71xx/packages/ip_2.6.29-1-2_ar71xx.ipk. Configuring ip. Configuring kmod-tun. Configuring kmod-ipv6. Configuring zlib. Configuring libopenssl. Configuring liblzo. Configuring openvpn-devel. root@OpenWrt:/tmp# openvpn |head -2 OpenVPN testing-f0b02a9dfab6 mips-openwrt-linux [SSL] [LZO2] [MH] [PF_INET6] [IPv6 payload 20100307-1] built on Jun 27 2010 root@OpenWrt:/tmp# }}}