{"id":3294,"date":"2014-05-11T14:02:02","date_gmt":"2014-05-11T14:02:02","guid":{"rendered":"http:\/\/ubuntuhandbook.org\/?p=3294"},"modified":"2014-05-11T14:02:02","modified_gmt":"2014-05-11T14:02:02","slug":"establish-openvpn-connection-ubuntu-1404","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2014\/05\/establish-openvpn-connection-ubuntu-1404\/","title":{"rendered":"How to Establish An OpenVPN Connection in Ubuntu 14.04"},"content":{"rendered":"<p>A <b>Virtual Private Network (VPN)<\/b> connection is an encrypted connection to a server. When you connect to a VPN server and type in a web address, the request is sent via an encrypted signal to the VPN server which then sends you back the web page.<\/p>\n<p>Establishing a VPN connection will keep your ISP or government from recording your browsing history. It can also be used to visit sites that your network administrator has blocked (in some countries like China youtube is blocked). An OpenVPN connection is the most secure type of VPN, because not only is the connection encrypted by<br \/>\na password, but also by three certificates.<\/p>\n<p>There are many places online that sell VPN services. In this tutorial, I will use vpnbook.com&#8217;s service, because it is completely free, and runs entirely off donations.<\/p>\n<p><b>PART 1: Get A Free OpenVPN Account<\/b><\/p>\n<p>Please skip this part if you already have a VPN server set up.<\/p>\n<p>1. Open up your web browser or just click the link to go to <a href=\"http:\/\/www.vpnbook.com\/\" target=\"_blank\">www.vpnbook.com<\/a>.<\/p>\n<p>2. Scroll down and click on the tab that says <b>OpenVPN<\/b> (as the picture shown below). Download one of the certificate bundles and also remember the username and password.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/vpnbook-account.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3295\" alt=\"Download OpenVPN Account\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/vpnbook-account.png\" width=\"599\" height=\"333\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/vpnbook-account.png 599w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/vpnbook-account-300x166.png 300w\" sizes=\"auto, (max-width: 599px) 100vw, 599px\" \/><\/a><\/p>\n<p>3. Decompress the downloaded package. Create 3 new empty text files in the result folder and called them: <b>ca.crt<\/b>, <b>certificate.crt<\/b>, <b>key.key<\/b>.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/openvpn-cert.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3296\" alt=\"openvpn key files\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/openvpn-cert.jpg\" width=\"580\" height=\"298\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/openvpn-cert.jpg 580w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/openvpn-cert-300x154.jpg 300w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>4. Open up one of the .ovpn files <i>(All of the .ovpn files are the same, but with different configurations.)<\/i> with gedit text editor, here I use <b>vpnbook-us1-tcp443.ovpn<\/b> as example.<\/p>\n<p>5. In the .ovpn file, do following copy and paste things and finally save the changes.<\/p>\n<blockquote><p>Copy everything between &lt;ca&gt; &lt;\/ca&gt; tags and paste into <b>ca.crt<\/b> file.<\/p>\n<p>Copy everything between &lt;cert&gt; &lt;\/cert&gt; tags and paste into <b>certificate.crt<\/b> file.<\/p>\n<p>Copy everything between &lt;key&gt; &lt;\/key&gt; tags and paste into <b>key.key<\/b> file.<\/p>\n<\/blockquote>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/copy-keys.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/copy-keys.png\" alt=\"copy-keys\" width=\"600\" height=\"408\" class=\"aligncenter size-full wp-image-3297\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/copy-keys.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/copy-keys-300x204.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p><b>PART 2: Setup OpenVPN connection:<\/b><\/p>\n<p>1. Press Ctrl+Alt+T on keyboard to open the terminal. When it opens, run the command below to install VPN plugin for network manager:<\/p>\n<pre style=\"border:none;\">sudo apt-get install network-manager-openvpn<\/pre>\n<p>2. Go to system area network icon -> VPN Connections -> Configure VPN:<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/Config-VPN-Ubuntu.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/Config-VPN-Ubuntu.png\" alt=\"Configure VPN in Ubuntu 14.04\" width=\"580\" height=\"406\" class=\"aligncenter size-full wp-image-3298\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/Config-VPN-Ubuntu.png 580w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/Config-VPN-Ubuntu-300x210.png 300w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>3. Click the <b>Add<\/b> button in next window and choose OpenVPN in drop-down menu as the connection type.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/add-openvpn.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/add-openvpn.png\" alt=\"Add OpenVPN in Ubuntu 14.04\" width=\"580\" height=\"255\" class=\"aligncenter size-full wp-image-3299\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/add-openvpn.png 580w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/add-openvpn-300x131.png 300w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>4. Now in VPN editing window, type in:<\/p>\n<blockquote><p>Connection name: type a name as you want<br \/>\nGateway: the IP address in the <b>vpnbook-us1-tcp443.ovpn<\/b> file.<br \/>\nType: Password with Certificates (TLS)<br \/>\nUsername: see the picture under PART 1 -> step 2.<br \/>\nPassword: see the picture under PART 1 -> step 2.<br \/>\nUser Certificate: choose the certificate.crt file.<br \/>\nCA Certificate: choose the ca.crt file.<br \/>\nPrivate Certificate: choose the key.key file.<br \/>\nPrivate Key Password: leave it empty.<\/p>\n<\/blockquote>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/vpn-settings.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/vpn-settings.png\" alt=\"vpn-settings\" width=\"600\" height=\"502\" class=\"aligncenter size-full wp-image-3300\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/vpn-settings.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/vpn-settings-300x251.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p><b>5. NOTE: Advanced settings depend on the <b>.ovpn<\/b> file you selected in PART 1 (step 4), find the ip, port, cipher and so forth at the top of .ovpn file<\/b><\/p>\n<p>Click the <b>Advanced<\/b> button. Check the boxes which say:<\/p>\n<blockquote><p>Use custom gateway port: 443<br \/>\nUse LZO data compression<br \/>\nUse a TCP connection<\/p>\n<\/blockquote>\n<p>Under Security tab, set Cipher to <b>AES-128-CBC<\/b><\/p>\n<p>6. When everything is done, connect to the VPN from network menu:<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/connect-to-openvpn.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/connect-to-openvpn.png\" alt=\"connect-to-openvpn\" width=\"492\" height=\"449\" class=\"aligncenter size-full wp-image-3301\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/connect-to-openvpn.png 492w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/connect-to-openvpn-300x273.png 300w\" sizes=\"auto, (max-width: 492px) 100vw, 492px\" \/><\/a><\/p>\n<p>You&#8217;re connected to the VPN if you see this message:<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/openvpn-connected.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/openvpn-connected.png\" alt=\"openvpn-connected\" width=\"467\" height=\"245\" class=\"aligncenter size-full wp-image-3302\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/openvpn-connected.png 467w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/05\/openvpn-connected-300x157.png 300w\" sizes=\"auto, (max-width: 467px) 100vw, 467px\" \/><\/a><\/p>\n<p>Enjoy!<\/p>","protected":false},"excerpt":{"rendered":"<p>A Virtual Private Network (VPN) connection is an encrypted connection to a server. When you connect to a VPN server and type in a web address, the request is sent via an encrypted signal to the VPN server which then sends you back the web page. Establishing a VPN connection will keep your ISP or [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[1077,1076,855],"class_list":["post-3294","post","type-post","status-publish","format-standard","hentry","category-howtos","tag-establish-an-openvpn-connection","tag-openvpn","tag-ubuntu-14-04"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/3294","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=3294"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/3294\/revisions"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=3294"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=3294"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=3294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}