*New 11.4 series Release:
2020-07-03: XigmaNAS 11.4.0.4.7633 - released!

*New 12.1 series Release:
2020-04-17: XigmaNAS 12.1.0.4.7542 - released


We really need "Your" help on XigmaNAS https://translations.launchpad.net/xigmanas translations. Please help today!

Producing and hosting XigmaNAS costs money. Please consider donating for our project so that we can continue to offer you the best.
We need your support! eg: PAYPAL

Jailed VPN

Transmission bittorrent server.
Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
redbranch
NewUser
NewUser
Posts: 2
Joined: 31 Jul 2013 21:27
Status: Offline

Jailed VPN

#1

Post by redbranch »

Ok. So to start off - I'm a Linux guy and have been for 13 years now. I'm a bit new on this bsd stuff, but things are starting to relate.

I've recently built a NAS4Free server with Jails provided by "The Brig". One of the jails houses SAB, CouchPotato, and SB, the second has my serviio server and it works great.

So my next trick is to get a vpn'd torrent client working in one of the jails. I've just recently gotten openvpn jailed and working *sort of* and I'd like the BSD junkies to take a look and see if there are any glaring issues, fixes, or better ways to do these things:

Code: Select all

##################################
########Torrent Downloader########
##################################
###Righteously ripped and modded from http://forums.freebsd.org/showthread.php?t=22143
###Create the jail and use the shared location for blackhole and completed files to be shared with serviio###
EXTENSIONS=>THE_BRIG=>CURRENT_JAILS_TAB:
SELECT:
Plus Sign
CHANGE:
Jail Number:3
Jail Name:Torrent
Jail Type:Slim
Jail IP Address:192.168.0.211/24
Fstab:
/mnt/rufus/Open /mnt/rufus/Jail/Torrent/mnt/VIDEO nullfs rw 0 0
Jail Source:From Archive
Official FreeBSD Flavor: 
FreeBSD-amd64-9.1-RELEASE-base.txz
FreeBSD-amd64-9.1-RELEASE-lib32.txz
SELECT:
Add
SELECT:
Apply Changes

###Create the mount point###
mkdir -p /mnt/rufus/Jail/Torrent/mnt/VIDEO

###Set the TUN0 interface to be cloned into the jails(I'm guessing)###
SYSTEM=>ADVANCED=>RC.CONF_TAB:
SELECT:
Plus Sign
Name:cloned_interfaces
Value:tun
SELECT:
add
SELECT:
Apply Changes

###Tell devfs to give tun0 access to the jails###
SYSTEM=>ADVANCED=>COMMAND_SCRITPS_TAB:
SELECT:
Plus Sign
Command:devfs -m /mnt/rufus/Jail/Torrent/dev rule apply path tun0 unhide
Type:PostInit
SELECT:
Add

###Im thinking this links the jail tun ip to the host tun ip?###
SYSTEM=>ADVANCED=>RC.CONF_TAB:
SELECT:
Plus Sign
Name:jail_Torrent_ip_multi0
Value:"tun0|10.8.0.1 10.8.0.2 mtu 1500 netmask 255.255.255.255"
SELECT:
add
SELECT:
Apply Changes

RESTART JAIL

LOGIN:
jexec *jail-id* csh

INSTALL:
pkg_add -rv openvpn

CREATE:
mkdir /usr/local/etc/openvpn

MOVE:
vpn files into above directory and rename .opv to "openvpn.conf"

MODIFY:
echo 'ifconfig-noexec' >>/usr/local/etc/openvpn/openvpn.conf

MODIFY:
vi /etc/rc.conf

ADD:
openvpn_enable="YES"
openvpn_configfile="/usr/local/etc/openvpn/openvpn.conf"
###########################################################
So I'm obviously not done with this - The jail doesn't route properly - which defeats the purpose of openvpn :oops:

But it does come up and I can see the connection on the host.

Thoughts? Solutions to the routing issue? Can a vpn in a jail set and change routing?

Thanks!
Last edited by redbranch on 31 Jul 2013 23:42, edited 1 time in total.

User avatar
raulfg3
Site Admin
Site Admin
Posts: 5117
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: Jailed VPN

#2

Post by raulfg3 »

please reduce Font size, i'm not blind.
12.0.0.4 (revision 6766)+OBI on SUPERMICRO X8SIL-F 8GB of ECC RAM, 12x3TB disk in 3 vdev in RaidZ1 = 32TB Raw size only 22TB usable

Wiki
Last changes

HP T510

redbranch
NewUser
NewUser
Posts: 2
Joined: 31 Jul 2013 21:27
Status: Offline

Re: Jailed VPN

#3

Post by redbranch »

raulfg3 wrote:please reduce Font size, i'm not blind.
How do you know that I'm not blind?

Post Reply

Return to “BitTorrent”