Ubuntu: Cannot bind Transmission (or any other app) to local IP when connected to VPN



Question:

I want all my applications to use VPN connection except for Transmission, which I want to use my eth0 interface. But when I set "bind-address-ipv4":"192.168.250.2" in the settings.jason , Transmission couldn't connect to any peer.

I also found out that I can't bind any application to local network interface when the VPN is connected, for example:

When the VPN is not connected:

$ ping -I 192.168.250.2 8.8.8.8  PING 8.8.8.8 (8.8.8.8) from 192.168.250.2 : 56(84) bytes of data.  64 bytes from 8.8.8.8: icmp_req=1 ttl=44 time=229 ms  64 bytes from 8.8.8.8: icmp_req=2 ttl=44 time=229 ms  64 bytes from 8.8.8.8: icmp_req=3 ttl=44 time=229 ms  64 bytes from 8.8.8.8: icmp_req=4 ttl=44 time=227 ms  64 bytes from 8.8.8.8: icmp_req=5 ttl=44 time=226 ms  ^C  --- 8.8.8.8 ping statistics ---  5 packets transmitted, 5 received, 0% packet loss, time 4004ms  rtt min/avg/max/mdev = 226.323/228.578/229.797/1.332 ms  

When the VPN is connected:

$ ping -I 192.168.250.2 8.8.8.8  PING 8.8.8.8 (8.8.8.8) from 192.168.250.2 : 56(84) bytes of data.  ^C  --- 8.8.8.8 ping statistics ---  133 packets transmitted, 0 received, 100% packet loss, time 132177ms  


Solution:1

I was able to get things right following this post on serverfault.

I just added these ip routing rules and everything went fine:

$ sudo ip route add default via 192.168.250.1 dev eth0 table 10  $ sudo ip rule add from 192.168.250.2 table 10  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »