Help with default routes for VPN/Plugins

Status
Not open for further replies.

mike6926

Cadet
Joined
Dec 19, 2012
Messages
3
Hi All,

I'm new to FreeNAS and I'm hoping someone can help me with a little conundrum I'm having.

GOAL:
-(as I've read here with a few people), I'd like to run to setup a VPN service on the box to hide my torrent traffic out to the internet.

WHAT I'VE DONE:
-Using FreeNAS-8.3.0-RELEASE-p1, I've started out installing openvpn within the JAIL. I had some issues with getting the tunnel setup at first.. However the main issue that prevented me from exploring it further was, if i was running the vpn, I wouldn't be able to access the jail for things such as minidlna.

-I have a HP N40L with a Dual NIC card in the system. Having an old DD-WRT router kicking around, I put it on my home network & setup the DD-WRT router to dial into the VPN directly. Therefore any host connecting to this router uses the VPN, any host connecting to my home router will not be going down the VPN.

NIC1-> HOME NETWORK <192.168.2.x>
NIC2-> VPN NETWORK <192.168.1.x>

-As traffic to the internet (from my NAS box) will only be torrent traffic, I want to use a default route through NIC2 to the VPN router. Any traffic destined for the home network through NIC2.

-If I set the default gateway to the home network, I have issues trying to get the internet traffic to go over the VPN (I've confirmed this to be the case with a routetrace).
-If I set the default gateway to the VPN, I will go out through the VPN router, however my JAIL/plugins will not work/respond as the JAIL IP is on the home network
--If at all possible, I'd like to keep the jail on the home network as it would be difficult to get my TV on the VPN network.

-I've tried using a GW of the home network, with a static route of 0.0.0.0/0 to the VPN (unknown traffic fwd to the VPN router).. this doesn't work
-from SSH, if I try to use a ROUTE ADD, it advises there's already a route to the VPN network.

Any thoughts?

Kind Regards,
Mike
 

mike6926

Cadet
Joined
Dec 19, 2012
Messages
3
Hi All,

Just an update. I think I'm on the right track. Within the JAIL, I went to /usr/pbi/transmission-amd64/etc/transmission/home/settings.json where I was able to pull it up in editor and set:

"alt-speed-down": 50,
"alt-speed-enabled": false,
"alt-speed-time-begin": 540,
"alt-speed-time-day": 127,
"alt-speed-time-enabled": false,
"alt-speed-time-end": 1020,
"alt-speed-up": 50,
"bind-address-ipv4": "<IP ADDRESS OF JAIL>",

Once I did this I was able to send data down my HOME NETWORK connection. As I do not have a connection from the JAIL to my VPN NETWORK, setting the bind-address-ipv4 to my VPN NETWORK address does not work....

Once I setup a 2nd nic within the JAIL, I think I should be up and running.. I will advise back should I find anything useful!

Thanks,
Mike
 

mike6926

Cadet
Joined
Dec 19, 2012
Messages
3
Hi All,

I've made some progress... Highlighted below is how you can create a new set of vNICs, add one to the Jail and bridge a physical NIC with the 2nd NIC in the Jail... Being new to FreeBSD in general, let alone running on a RAM Disk, I have to figure out to make the changes across reboots.... i'm sure that won't be a problem.

The main issue I have at the moment is setting up a routing policy where torrent traffic goes down one path and firefly/miniDLNA traffic (which unfortunately is broadcast traffic) down the other network.... I'm sure there's someway around it... I just haven't gotten through it yet..


#creates two vNICs
ifconfig epair create

#Moves 2nd vNIC to JAIL <Process ID>
ifconfig epair1b vnet 1

#Assigns IP Address to JAIL NIC and bring the interface up
jexec 1 ifconfig epair1b 192.168.2.241 netmask 255.255.255.0 up

#Brings up 1st vNIC
ifconfig epair1a up

#Create bridge
ifconfig bridge create

#Assign vNIC in JAIL with Physical NIC on machine
ifconfig bridge1 addm em0 addm epair1b up
 
Status
Not open for further replies.
Top