{"id":303,"date":"2013-08-28T12:36:01","date_gmt":"2013-08-28T11:36:01","guid":{"rendered":"http:\/\/paguilar.org\/?p=302"},"modified":"2013-12-27T00:46:48","modified_gmt":"2013-12-26T23:46:48","slug":"cross-compiling-openvpn","status":"publish","type":"post","link":"https:\/\/paguilar.org\/?p=303","title":{"rendered":"Cross-compiling OpenVPN"},"content":{"rendered":"<p><a href=\"https:\/\/paguilar.org\/wp-content\/uploads\/2013\/12\/openvpn_logo.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-346\" alt=\"openvpn_logo\" src=\"https:\/\/paguilar.org\/wp-content\/uploads\/2013\/12\/openvpn_logo.png\" width=\"208\" height=\"54\" \/><\/a><\/p>\n<p>OpenVPN is an open source software application used for creating SSL\/TLS VPN that provides secure point-to-point connections in routed or bridged configurations and remote access facilities.<\/p>\n<p>Cross-compiling the latest version 2.3.2 is an easy procedure, no makefiles of other files have to be modified:<\/p>\n<p><strong>Download package<\/strong><br \/>\n<a href=\"http:\/\/swupdate.openvpn.org\/community\/releases\/openvpn-2.3.2.tar.gz\">openvpn-2.3.2.tar.gz<\/a><\/p>\n<p><strong>Requirements<\/strong><br \/>\nThis library is built on top of <a href=\"http:\/\/www.openssl.org\/\">OpenSSL<\/a> and <a href=\"http:\/\/www.oberhumer.com\/opensource\/lzo\/\">LZO<\/a>. It&#8217;s quite probable that you already have both packages installed in your embedded device since they&#8217;re quite common.<\/p>\n<p><strong>Environment configuration<\/strong><br \/>\nAs normal, set the environment variables that make our life easier. Change them according to your needs. These settings are for an ARM based processor:<\/p>\n<pre lang=\"bash\">$ export HOST=arm-linux\r\n$ export BUILD=i386-linux\r\n$ export PREFIX=\/home\/projects\/rootfs\/usr\/local<\/pre>\n<p><strong>Configuration<\/strong><br \/>\nI already have OpenSSL and LZO installed in my embedded system (buildroot installed them for me), however I had to specify where the LZO header files and library were located:<\/p>\n<pre lang=\"bash\">LZO_CFLAGS=\"-I$PREFIX\/usr\/include\" \r\nLZO_LIBS=\"-L$PREFIX\/usr\/lib -llzo2\" \r\n.\/configure \r\n--target=arm-linux \r\n--host=arm-linux \r\n--build=i686-pc-linux-gnu \r\n--prefix=$PREFIX \r\n--enable-static \r\n--enable-shared \r\n--enable-small \r\n--disable-plugins \r\n--disable-debug<\/pre>\n<p><strong>Compilation and installation<\/strong><\/p>\n<pre lang=\"bash\">make\r\nmake install<\/pre>\n<p>The last step will install some documentation that you can get rid of, a header file <em>openvpn-plugin.h<\/em> that you will need only if you compiile an OpenVPn plugin and the binary <em>openvpn<\/em> that is what you need.<\/p>\n<p>Here are some tutorials for configuring an OpenVPN client\/server and learning the basic ideas behind it:<\/p>\n<ul>\n<li><a href=\"http:\/\/openvpn.net\/index.php\/open-source\/documentation.html\">Official documentation<\/a><\/li>\n<li><a href=\"http:\/\/openmaniak.com\/openvpn.php\">OpenVPN concepts<\/a><\/li>\n<li><a href=\"https:\/\/www.digitalocean.com\/community\/articles\/how-to-setup-and-configure-an-openvpn-server-on-centos-6\">OpenVPN server on CentOS<\/a><\/li>\n<li><a href=\"http:\/\/zeroshell.net\/openvpn-client\/\">Good tutorial in italian<\/a><\/li>\n<\/ul>\n<p>That&#8217;s it. Have fun!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>OpenVPN is an open source software application used for creating SSL\/TLS VPN that provides secure point-to-point connections in routed or bridged configurations and remote access facilities. Cross-compiling the latest version 2.3.2 is an easy procedure, no makefiles of other files have to be modified: Download package openvpn-2.3.2.tar.gz Requirements This library is built on top of\u2026 <span class=\"read-more\"><a href=\"https:\/\/paguilar.org\/?p=303\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,14,15],"tags":[52,21,58,28,59,43],"class_list":["post-303","post","type-post","status-publish","format-standard","hentry","category-compiling","category-networking","category-security","tag-compiling","tag-cross-compile","tag-networking","tag-openvpn","tag-security","tag-vpn"],"_links":{"self":[{"href":"https:\/\/paguilar.org\/index.php?rest_route=\/wp\/v2\/posts\/303","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/paguilar.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/paguilar.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/paguilar.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/paguilar.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=303"}],"version-history":[{"count":2,"href":"https:\/\/paguilar.org\/index.php?rest_route=\/wp\/v2\/posts\/303\/revisions"}],"predecessor-version":[{"id":347,"href":"https:\/\/paguilar.org\/index.php?rest_route=\/wp\/v2\/posts\/303\/revisions\/347"}],"wp:attachment":[{"href":"https:\/\/paguilar.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=303"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/paguilar.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=303"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/paguilar.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=303"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}