{"id":11016,"date":"2018-01-29T10:09:49","date_gmt":"2018-01-29T15:09:49","guid":{"rendered":"http:\/\/tblog.myriad.ca\/?p=179"},"modified":"2022-08-20T07:20:21","modified_gmt":"2022-08-20T11:20:21","slug":"set-up-vpn-transmission-on-freenas-11-1-2","status":"publish","type":"post","link":"https:\/\/myriad.ca\/index.php\/2018\/01\/29\/set-up-vpn-transmission-on-freenas-11-1-2\/","title":{"rendered":"Set up Torguard VPN for Transmission on Freenas 11.3 &#8211; Updated for 2020!"},"content":{"rendered":"[vc_row type=&#8221;in_container&#8221; full_screen_row_position=&#8221;middle&#8221; column_margin=&#8221;default&#8221; column_direction=&#8221;default&#8221; column_direction_tablet=&#8221;default&#8221; column_direction_phone=&#8221;default&#8221; scene_position=&#8221;center&#8221; text_color=&#8221;dark&#8221; text_align=&#8221;left&#8221; row_border_radius=&#8221;none&#8221; row_border_radius_applies=&#8221;bg&#8221; overflow=&#8221;visible&#8221; overlay_strength=&#8221;0.3&#8243; gradient_direction=&#8221;left_to_right&#8221; shape_divider_position=&#8221;bottom&#8221; bg_image_animation=&#8221;none&#8221;][vc_column column_padding=&#8221;no-extra-padding&#8221; column_padding_tablet=&#8221;inherit&#8221; column_padding_phone=&#8221;inherit&#8221; column_padding_position=&#8221;all&#8221; column_element_direction_desktop=&#8221;default&#8221; column_element_spacing=&#8221;default&#8221; desktop_text_alignment=&#8221;default&#8221; tablet_text_alignment=&#8221;default&#8221; phone_text_alignment=&#8221;default&#8221; background_color_opacity=&#8221;1&#8243; background_hover_color_opacity=&#8221;1&#8243; column_backdrop_filter=&#8221;none&#8221; column_shadow=&#8221;none&#8221; column_border_radius=&#8221;none&#8221; column_link_target=&#8221;_self&#8221; column_position=&#8221;default&#8221; gradient_direction=&#8221;left_to_right&#8221; overlay_strength=&#8221;0.3&#8243; width=&#8221;1\/1&#8243; tablet_width_inherit=&#8221;default&#8221; animation_type=&#8221;default&#8221; bg_image_animation=&#8221;none&#8221; border_type=&#8221;simple&#8221; column_border_width=&#8221;none&#8221; column_border_style=&#8221;solid&#8221;][vc_column_text]Nowadays, it is prudent to protect your privacy when downloading torrents on the net.\u00a0 A few lawsuits have recently been brought against ISP&#8217;s by businesses seeking damages from users allegedly downloading illegal content. Many of these lawsuits have centered on trying to get the ISP&#8217;s to release lists of customer IP addresses along with their associated activity logs. In this post you will learn how to install a VPN in the Transmission jail and when correctly set up, all your Transmission traffic will subsequently go through the VPN.<\/p>\n<p>Using the Radarr, Transmission and Medusa plugins, my NAS system is better than it has ever been and\u00a0 I was also able to import my ZFS raid disks from my old N4F server with no problems. By following this post carefully you will easily be able to get OpenVPN installed and working though the FreeNAS Transmission jail to ensure only protected traffic is tunneled through our BT client. In my experience, this process is WAY easier that the setup required for N4F and I have setup 3 systems now with no problems using this method! Just so we&#8217;re clear, this post is NOT meant to be a tutorial on how to set up FreeNas. There are many ways to configure the FN server that depend largely on your system architecture &#8211; so head on over to the <a href=\"https:\/\/forums.freenas.org\/index.php\" target=\"_blank\" rel=\"noopener noreferrer\">FN forums<\/a> if you have basic operational questions.<\/p>\n<p>This how-to is adapted from a post in the FN forums by Tango and I have modified it to work with Torguard though it might work with other VPN providers as well (your mileage may vary). This tutorial assumes you have your Freenas server setup and working correctly and that you have installed and tested the Transmission plugin to your satisfaction. I am currently using Torguard and I can highly recommend them. They offer many locations worldwide, are reasonably priced and have excellent customer service when you need it.<\/p>\n<p>If you can&#8217;t see the button below please disable your ADBLOCKER for my site. I promise will never give you ads or track you in any way, but unfortunately the ad blockers see the link below as an ad and erase it from the displayed HTML. Thank you for your cooperation!<\/p>\n<a class=\"nectar-button n-sc-button small accent-color regular-button\"  href=\"https:\/\/torguard.net\/aff.php?aff=215\/\" data-color-override=\"false\" data-hover-color-override=\"false\" data-hover-text-color-override=\"#fff\"><span>Click Here to Try Torguard<\/span><\/a>\n<h3><strong>Here are the steps I followed to get VPN working on my FreeNas 11.1 server:<\/strong><\/h3>\n<div>\n<ol>\n<li>You will need a VPN provider in order to get this going. <a href=\"https:\/\/torguard.net\/aff.php?aff=215\" target=\"_blank\" rel=\"noopener noreferrer\">Click here to try Torguard.<\/a><\/li>\n<li>SSH into freenas. (I use <a href=\"https:\/\/www.putty.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">PuTTy<\/a>)<\/li>\n<li>Get a list of jails:<br \/>\n<code>root@freenas ~ : jls<br \/>\nJID IP Address   Hostname       Path<br \/>\n3 - 192.168.1.50 transmission_1 \/mnt\/\/jails\/transmission_1  <\/code><\/li>\n<li>jexec into the jail (mine happens to be 3 &#8211; yours may vary):<br \/>\n<code>root@freenas: ~ : jexec 3 tsch \/bin\/sh #(if you are having trouble try- sudo<br \/>\njexec 3 \/bin\/sh) root@transmisssion_1: ~ \/ :<\/code><\/li>\n<li>Install bash. May be prompted several times &#8211; reply Y then press enter each time:<br \/>\n<code>root@transmission_1: ~ \/ : pkg install bash <\/code><\/li>\n<li>Install nano. Again, may be prompted several times. Reply Y each time:<br \/>\n<code>root@transmission_1: ~ \/ : pkg install nano <\/code><\/li>\n<li>Move to the \/etc folder:<br \/>\n<code>root@transmission_1: ~ \/ : cd \/etc<br \/>\nroot@transmission_1: ~ \/etc : ,\/code&gt;<\/code><\/li>\n<li>Fetch Portsnap via portsnap fetch:<br \/>\n**This will take a while to download and ask for several prompts &#8211; you know the drill.<br \/>\n<code>root@transmission_1: ~ \/etc : portsnap fetch<\/code><\/li>\n<li>Extract Ports to \/usr\/ports: **This will also take a long time and A LOT of scrolling will happen. It&#8217;s normal.<br \/>\n<code>root@transmission_1: ~ \/etc : portsnap extract<\/code><\/li>\n<li>Navigate to \/usr\/ports\/security\/openvpn:<br \/>\n<code>root@transmission_1: ~ \/etc : cd \/usr\/ports\/security\/openvpn<br \/>\nroot@transmission_1: ~ \/usr\/ports\/security\/openvpn <\/code><\/li>\n<li>Make a clean install which allows us to set the option of a password file:<br \/>\n<code>root@transmission_1: ~ \/usr\/ports\/security\/openvpn : make install clean<\/code><br \/>\n**Blue screen should appear. Press the DOWN arrow and the SPACE bar to ensure the [ ] next to PW_Save ( 5th option down) has an X in it. Should look this:<br \/>\nx+[X] PW_Save \u00a0 Interactive passwords may be read from a file<br \/>\n(On latest versions of openvpn (Mar. 2016) you <em>MAY NOT<\/em> get an option #5 as described above, but openvpn appears to read passwords from a textfile anyways so you can safely skip this step.)<br \/>\n**then press enter. Lots of things should happen now&#8230;<\/li>\n<li>Go to root directory of the transmission_1 jail:<br \/>\n<code>root@tranmission_1: ~ \/usr\/ports\/security\/openvpn : cd \/<br \/>\nroot@transmission_1: ~ \/ :<\/code><\/li>\n<li>Enter Bash:<br \/>\n<code>root@transmission_1: ~ \/ : bash<br \/>\nroot@transmission_1: ~ \/ :<\/code><\/li>\n<li>Make a directory for OpenVPN &amp; our files that we will download from Torguard:<br \/>\n<code>root@transmission_1: ~ \/ : mkdir \/usr\/local\/etc\/openvpn:<\/code><\/li>\n<li>Add lines to the rc.conf so OpenVPN starts when the jail starts:<br \/>\n<code>root@transmission_1 ~ \/ : cd \/etc # Note \u2013 use Ctrl+o will write the file and Ctrl+X will exit.<br \/>\nroot@transmission_1 ~ \/etc : nano rc.conf # File is open.<br \/>\n# Add the following (can copy\/paste using ctrl+C then right clicking in the shell)<br \/>\nopenvpn_enable=\u201dYES\u201d<br \/>\nopenvpn_configfile=\u201d\/usr\/local\/etc\/openvpn\/openvpn.conf\u201d<br \/>\n# Write via Ctrl+O. Press Enter<br \/>\n# Exit via Ctrl+X.<\/code><\/li>\n<li>Move to a new folder (helps me keep things straight):<br \/>\n<code>root@transmission_1 ~ \/etc : cd \/media\/<\/code><\/li>\n<li>Grab the Torguard files, you&#8217;ll likely need to grab them manually and install them through the FreeNas GUI as Torguard does not allow wget file transfers. If you have created your Transmission jail storage correctly (see link at beginning of article) you should be able to drag the Torguard files into your shared NAS &#8216;downloads&#8217; directory and see them symlinked in your jail&#8217;s &#8216;\/media&#8217; directory.<br \/>\nYou will need a login <a href=\"https:\/\/torguard.net\/aff.php?aff=215\" target=\"_blank\" rel=\"noopener noreferrer\">CLICK HERE to check out Torguard<\/a>. Here is the link once you are logged in: <a href=\"https:\/\/torguard.net\/downloads.php\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/torguard.net\/downloads.php<\/a>. You will want to grab the &#8216;<strong>Standard Port 443\/TCP Configs<\/strong>&#8221; in the &#8220;<strong>OpenVPN Config Files and Scripts<\/strong>&#8221; section (near the bottom).<\/li>\n<li>Unzip the Torguard openvpn files into the &#8216;Media&#8217; folder:<br \/>\n<code>root@transmission_1 ~ \/media : cp TorguardPRO.ovpn\/<\/code><\/li>\n<li>Make a pass.txt file to hold your username and password:<br \/>\n<code>root@tranmission_1 ~ \/media : nano pass.txt<br \/>\n# Nano will pop up. ONLY type in the following (substituting your REAL username and password of course)<br \/>\nUSER<br \/>\nPASSWRD<br \/>\n# Press Ctrl+o. call it pass.txt. then enter. then Ctrl+X<\/code><\/li>\n<li>Configure the .ovpn file of your selected server\u00a0 (I used a Canadian-based.ovpn&#8217; as it is still legal to torrent in Canada at this time. Torguard asks that you <em>NOT<\/em> use US-based servers for torrenting):<br \/>\n<code>root@tranmission_1: ~ \/media : nano 'Your_Selected.ovpn<br \/>\n# On the auth-user-pass line add pass.txt after it like so: auth-user-pass pass.txt<br \/>\n# Press Ctrl+o. call it Your_Selected.ovpn. then enter. then Ctrl+X<\/code><\/li>\n<li>Move the fixed Torguard files** into the correct folder we just created<br \/>\n**The actual OpenVPN files we created in Step 20 above:<br \/>\n<code>#ca.crt next:<br \/>\nroot@transmission_1: ~ \/media : cp \/media\/ca.crt \/usr\/local\/etc\/openvpn\/ca.crt<br \/>\n# our pass.txt file we created:<br \/>\nroot@transmission_1: ~ \/media : cp \/media\/pass.txt \/usr\/local\/etc\/openvpn\/pass.txt .ovpn file to .conf file<br \/>\n(You'll have to use \"\" around the name if there is a space in it.)<br \/>\nroot@transmission_1: ~ \/media : cp \/media\/Your_Selected.ovpn \/usr\/local\/etc\/openvpn\/openvpn.conf<\/code><\/li>\n<li>Start your OpenVPN server:<br \/>\n<code>root@transmission_1 ~ \/ : \/usr\/local\/etc\/rc.d\/openvpn start<\/code><\/li>\n<li>Check your install. You should be able to query the VPN tunnel:<br \/>\n<code>root@tranmission_1: ~ \/media : ifconfig tun0 # You should see a printout like:<br \/>\n# ifconfig tun0<br \/>\ntun0: flags=8051 metric 0 mtu 1500<br \/>\noptions=80000<br \/>\ninet 10.9.0.22 --&gt; 10.9.0.21 netmask 0xffffffff<br \/>\nnd6 options=1<br \/>\nOpened by PID 7036<br \/>\n# Or something similar...<\/code><\/li>\n<li>Congratulations! Your Transmission packets are now using Torguard!<\/li>\n<li>One caveat worth mentioning here:\u00a0 You probably won&#8217;t be able to automagically update the Transmission client from the GUI as I have never been able to get it to successfully update itself. Whether that is the fault of our modifications or just a bug in Freenas I am not sure. To update, just make a note of your Transmission jail&#8217;s storage structure and delete the plugin and re-install according to the guide again. It&#8217;s a bit of a PITA &#8211; but for now, it is the only way.<\/li>\n<\/ol>\n<h4><\/h4>\n<h4>Not Working? Check out these useful commands and troubleshooting tips.<\/h4>\n<h5>Useful Open VPN Commands:<\/h5>\n<p><code>#Stop openvpn<br \/>\nroot@transmission_1: ~ \/ : \/usr\/local\/etc\/rc.d\/openvpn stop<br \/>\n#Start openvpn<br \/>\nroot@transmission_1: ~ \/ : \/usr\/local\/etc\/rc.d\/openvpn start<br \/>\n#Restart openvpn<br \/>\nroot@transmission_1: ~ \/ : \/usr\/local\/etc\/rc.d\/openvpn restart<br \/>\n#Query Secure network VPN tunnel<br \/>\nroot@tranmission_1: ~ \/ : ifconfig tun0<br \/>\n#Query whole Freenas network<br \/>\nroot@transmission_1: ~ \/ : ifconfig<br \/>\n# stop all openvpn processes<br \/>\nroot@transmission_1: ~ \/ : killall -TERM openvpn<\/code><\/p>\n<p><em>Still<\/em> not working as you expect? Check out the log files in Freenas before you post a comment.<\/p>\n<p>Still not working? Check <a href=\"http:\/\/www.freebsddiary.org\/openvpn.php\" target=\"_blank\" rel=\"noopener noreferrer\">this post<\/a> for clues (it&#8217;s a good troubleshooting primer as well).\u00a0 Just telling me it&#8217;s not working does not provide enough information to troubleshoot your problem. You wouldn&#8217;t take your car into the garage and say, &#8220;my car doesn&#8217;t work!&#8221; &#8211; you need to give me some clues to help you fix your problem. Check your steps carefully, every command has to be issued as it is shown in the how to.\u00a0 If you find any mistakes please let me know and I will fix them right away.<\/p>\n<\/div>\n[\/vc_column_text][\/vc_column][\/vc_row]\n","protected":false},"excerpt":{"rendered":"<p>[vc_row type=&#8221;in_container&#8221; full_screen_row_position=&#8221;middle&#8221; column_margin=&#8221;default&#8221; column_direction=&#8221;default&#8221; column_direction_tablet=&#8221;default&#8221; column_direction_phone=&#8221;default&#8221; scene_position=&#8221;center&#8221; text_color=&#8221;dark&#8221; text_align=&#8221;left&#8221; row_border_radius=&#8221;none&#8221; row_border_radius_applies=&#8221;bg&#8221; overflow=&#8221;visible&#8221; overlay_strength=&#8221;0.3&#8243; gradient_direction=&#8221;left_to_right&#8221; shape_divider_position=&#8221;bottom&#8221; bg_image_animation=&#8221;none&#8221;][vc_column column_padding=&#8221;no-extra-padding&#8221; column_padding_tablet=&#8221;inherit&#8221; column_padding_phone=&#8221;inherit&#8221; column_padding_position=&#8221;all&#8221; column_element_direction_desktop=&#8221;default&#8221; column_element_spacing=&#8221;default&#8221; desktop_text_alignment=&#8221;default&#8221; tablet_text_alignment=&#8221;default&#8221;&#8230;<\/p>\n","protected":false},"author":2,"featured_media":11860,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[167],"tags":[41,42,43],"class_list":{"0":"post-11016","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-freebsd","8":"tag-openvpn","9":"tag-torguard","10":"tag-transmission"},"_links":{"self":[{"href":"https:\/\/myriad.ca\/index.php\/wp-json\/wp\/v2\/posts\/11016","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myriad.ca\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myriad.ca\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myriad.ca\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/myriad.ca\/index.php\/wp-json\/wp\/v2\/comments?post=11016"}],"version-history":[{"count":25,"href":"https:\/\/myriad.ca\/index.php\/wp-json\/wp\/v2\/posts\/11016\/revisions"}],"predecessor-version":[{"id":12767,"href":"https:\/\/myriad.ca\/index.php\/wp-json\/wp\/v2\/posts\/11016\/revisions\/12767"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/myriad.ca\/index.php\/wp-json\/wp\/v2\/media\/11860"}],"wp:attachment":[{"href":"https:\/\/myriad.ca\/index.php\/wp-json\/wp\/v2\/media?parent=11016"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myriad.ca\/index.php\/wp-json\/wp\/v2\/categories?post=11016"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myriad.ca\/index.php\/wp-json\/wp\/v2\/tags?post=11016"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}