Instead of manually setting the new IP in the preferences, the plugin IfaceWatch can be used to do this automatically based on the network interface name.
However, if deluge is setup to listen on a specific IP, it is also necessary to update deluge with the new IP. Whenever the IP on the VPN interface changes (for whatever reason), it is necessary to update the routing table with the new IP. $ setfib -1 traceroute Handling IP changes on VPN interface To test that it works, you can use traceroute: When starting openvpn the alternate routing table should be set up
Up "/usr/local/etc/openvpn/link-up.sh tun0"
Create /usr/local/etc/openvpn/link-up.sh with the following content:.Using openvpn you can set up the alternate routing table automatically: $ setfib -1 /path/to/deluged -l /var/log/deluged/deluged.log -L info -i With an alternate routing table already set up (on -1) you can start Deluge daemon with: This requires recompiling the kernel with this option enabled (See this blog post for details). Scripts for a basic setup can be found at the deluge-vpn repo.įreeBSD supports multiple routing tables in the kernel, which enables a process to be started with a custom default routing table. Route all traffic that matches specific ports or protocolsīy marking all packets produced by processes owned by a specific user, it is not necessary to add filters on the type of traffic that should be routed.traffic from all processes owned by a specific user) through the VPN interface. Route all traffic from a specific user (i.e.Routing only specific traffic through the VPN interface can be useful, but is also the most tricky to configure.ĭirecting only some traffic through the VPN interface can be achieved using iptables. All network traffic passes through the default interface except for the traffic you specifically want to route through the VPN interface. Use the VPN connection only for specific traffic.This way all the traffic from the host uses the VPN. Use the VPN as the primary connection with default routing passing through the VPN.There are two basic options when using VPN. Route traffic through TUN via program options.