I don't download anything illegal with Vuze (a bittorrent client) and have no need to use my VPN (which is set up on my private VPS, using OpenVPN on both the server and client) on it. How do I force vuze to not use my VPN? I only have 500GB bandwith from my host per month.
2 Answers
I will assume you are using Linux, where it can be done. You will need to:
- Create a new ethernet virtual interface (vif);
- set-up policy based routing;
- download a small application which forces vuze to bind to a specific IP address.
For sake of simplicty, we shall suppose you are on a LAN subnet 192.168.1.0/24, your router is 192.168.1.1, and you will want a new address 192.168.1.247.
You may proceed so:
# ip link add link eth0 name eth0.1 type vlan id 1
# ip addr add 192.168.1.247/24 dev eth0.1
# ip link set dev eth0.1 up
This creates a virtual interface called eth0.1, with IP address (192.168.1.247) which you must choose amongst those allowed by your LAN, and a suitable mask.
Now we set up policy routing: let us create another routing table,
# echo 200 NAME >> /etc/iproute2/rt_tables
where you will want to choose a name meaningful to you, instead of NAME. Then we configure its routing,
# ip route add 192.168.1.0/24 dev eth0.1 src 192.168.1.247 table NAME
Then we add a default gateway,
# ip route add default via 192.168.1.1 table <NAME>
Careful, here 192.168.1.1 is the address of your router, when you are not connected to the VPN. Lastly, we introduce a rule:
# ip rule add from 192.168.1.247 table NAME
which specifies when to apply the new routing table. We are done with routing.
Now you download the program bind.c from this site, you compile it and install it as follows:
# gcc -nostartfiles -fpic -shared bind.c -o bind.so -ldl -D_GNU_SOURCE
# strip bind.so
# cp -i bind.so /usr/lib/
and we are now ready: this command
# BIND_ADDR="192.168.1.247" LD_PRELOAD=/usr/lib/bind.so vuze
will allow you to bind vuze to the given IP address, which is routed via the newly installed routing table, without any reference to (and thus outside) the VPN.
- 48,517
- 12
- 86
- 136
There's an old tool called ForceBindIP for Windows that can probably do what you're after.
It's still alive at this URL: http://old.r1ch.net/stuff/forcebindip/
It's a console application wrapper that does some networking trickery to ensure that only traffic from a single interface is allowed to be used by a process.
Normally, you'd want to use this to force your torrent client (or whatever) to strictly use your VPN, and halt all traffic if the VPN is down. I don't see why you can't do the opposite - bind your application to your main network adapter (instead of the VPN adapter). Then all traffic should flow through your non-VPN connection.
Run the command something like this:
forcebindip.exe 1.2.3.4 "C:\Program Files\Vuze\Azureus.exe"
Where 1.2.3.4 is your IPv4 address on your network. You can find this by typing ipconfig /all from a command prompt. Or, if you disconnect your VPN briefly, just Google "my ip" and it will tell you at the top.
- 449