Page 1 of 1
Redirection through VPN
Posted: Sat May 02, 2015 6:52 am
by rexhunt
Hi,
I have been using deluge on my headless server for a while and have found it to be very good. Recently I have become concerned about exposing my IP address through torrents.
To solve this I have set up a vpn that I can connect using
This creates an interface (ppp0) that I wish to send all deluge traffic through. The problem is that I run a webserver and soon a mailserver from the same machine. I can't have the traffic for the servers going through the VPN so for the last few weeks I have been looking for a way to force all traffic from deluge only through the VPN.
I have iptables installed and have been trying to send all traffic for user deluge through the VPN. However when I do this the trackers don't connect.
I was wondering if anybody here has any ideas on either what I can try next?
Thanks,
Rex
Re: Redirection through VPN
Posted: Sat May 02, 2015 4:24 pm
by bro
Hi
The common solution for this is to route traffic based on ports, so that all the traffic going through your predefined ports are routed differently. As described in the
UserGuide/VPN, this problem can be solved on FreeBSD with multiple default routing tables, by specifying which routing table a specific process should use. Linux doesn't have support for per-process routing table, but you may be able to use the iptables
owner module to achieve the same thing (
http://linuxpoison.blogspot.no/2010/11/ ... -user.html). How do your iptables rules look?
Re: Redirection through VPN
Posted: Mon May 04, 2015 7:10 am
by rexhunt
Hi,
I'll have a look through those links now to see if I can find anything. My current iptables configuration is the result of trying a lot of different things over the last few weeks.
Code: Select all
Server:/var/lib/deluge/.config/deluge# iptables -L -t nat
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
DNAT udp -- anywhere anywhere udp spts:!1:100 owner UID match deluge to:10.3.92.22
DNAT tcp -- anywhere anywhere tcp spts:!tcpmux:100 owner UID match deluge to:10.3.92.22
DNAT tcp -- anywhere anywhere tcp spt:!8112 owner UID match deluge to:10.3.92.22
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
Where 10.3.92.22 is the IP reported by ifconfig as the ip address for ppp0.
To my mind the logic underlying the iptables configuration is something like this:
Code: Select all
IF UID is deluge (ie. all traffic created by the user deluge, nothing else should be run as him.)
SEND via ppp0 (Possibly specifying via IP address)
ENDIF
Am I on the right track or do you think I'm barking up the wrong tree?
Thanks,
Rex
Re: Redirection through VPN
Posted: Fri May 08, 2015 9:43 am
by rexhunt
Hi,
I have solved this issue. I have set up connections using proxies rather than a VPN which seems to suit for now at least.
Regards,
Rex