{"id":247,"date":"2016-05-11T03:29:27","date_gmt":"2016-05-11T03:29:27","guid":{"rendered":"http:\/\/softinite.com\/?p=247"},"modified":"2016-07-27T01:37:55","modified_gmt":"2016-07-27T01:37:55","slug":"configuring-openvpn-client-in-openwrt","status":"publish","type":"post","link":"http:\/\/softinite.com\/?p=247","title":{"rendered":"Configuring OpenVPN client in OpenWrt"},"content":{"rendered":"<p>Below steps are based on <a href=\"https:\/\/superuser.com\/questions\/827031\/how-to-configure-openwrt-openvpn-bridge\">this<\/a> article.<\/p>\n<p>It is assumed that OpenVPN configuration files will be located under \/etc\/openvpn .<\/p>\n<ol>\n<li>If you haven&#8217;t done it already, then install openvpn &#8216;opkg update&#8217; followed by &#8216;opkg install openvpn-openssl&#8217;<\/li>\n<li>scp ca.crt, crl.pem and myConfig.ovpn to \/etc\/openvpn -&gt; feel free to create the folder if it does not exist<\/li>\n<li>create credentials file -&gt; \/etc\/openvpn\/myCred.p with 2 lines: username\/password<\/li>\n<li>edit myConfig.ovpn and make sure &#8216;auth-user-pass&#8217; is followed by &#8216;\/etc\/openvpn\/myCred.p&#8217;<\/li>\n<li>also set &#8216;dev tun0&#8217;, comment out &#8216;persist-tun&#8217; and add &#8216;redirect-gateway def1&#8217;<\/li>\n<li>save<\/li>\n<li>edit \/etc\/config\/network and add<\/li>\n<\/ol>\n<pre><code>config interface 'vpn'\r\n        option ifname 'tun0'\r\n        option proto 'none'\r\n\r\n8.  edit \/etc\/config\/firewall and add\r\n<\/code><\/pre>\n<pre><code>config zone\r\n        option name             vpn\r\n        list   network          'vpn'\r\n        option input            REJECT\r\n        option output           ACCEPT\r\n        option forward          REJECT\r\n        option masq             1\r\n\r\nconfig forwarding\r\n        option src              lan\r\n        option dest             vpn\r\n\r\n9. edit \/etc\/config\/openvpn and make sure\r\n\r\nconfig openvpn custom_config\r\n\r\n # Set to 1 to enable this instance:\r\n option enabled 1\r\n\r\n # Include OpenVPN configuration\r\n option config \/etc\/openvpn\/myConfig.ovpn\r\n\r\n10. reboot\r\n11.<\/code><code>\/etc\/init.d\/openvpn start\r\n12. If internet is available, then make it permanent via<\/code><\/pre>\n<pre><code>\/etc\/init.d\/openvpn enable<\/code><\/pre>\n<pre><code>\u00a0<\/code><\/pre>\n<pre><code>\u00a0<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Below steps are based on <a href=\"https:\/\/superuser.com\/questions\/827031\/how-to-configure-openwrt-openvpn-bridge\">this<\/a> article.<\/p>\n<p>It is assumed that OpenVPN configuration files will be located under \/etc\/openvpn .<\/p>\n<p>If you haven&#8217;t done it already, then install openvpn &#8216;opkg update&#8217; followed by &#8216;opkg install openvpn-openssl&#8217;<br \/>\nscp &#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_newsletter_tier_id":0,"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[13],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7uKYI-3Z","_links":{"self":[{"href":"http:\/\/softinite.com\/index.php?rest_route=\/wp\/v2\/posts\/247"}],"collection":[{"href":"http:\/\/softinite.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/softinite.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/softinite.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/softinite.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=247"}],"version-history":[{"count":7,"href":"http:\/\/softinite.com\/index.php?rest_route=\/wp\/v2\/posts\/247\/revisions"}],"predecessor-version":[{"id":254,"href":"http:\/\/softinite.com\/index.php?rest_route=\/wp\/v2\/posts\/247\/revisions\/254"}],"wp:attachment":[{"href":"http:\/\/softinite.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=247"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/softinite.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=247"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/softinite.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=247"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}