1

I am trying to route my vpn traffic over TOR (Tor is using bridges) on ubuntu by simply adding the following in the tor configuration:

UseBridges 1
Bridge bridge1 fingerprint1
Bridge bridge2 fingerprint2
SocksPort 9050 PreferSOCKSNoAuth

and the following is the openvpn configuration:

client
dev tun
proto tcp
remote ip port
resolv-retry infinite
nobind
persist-key
persist-tun
cipher aes-256-cbc
auth sha256
tls-client
remote-cert-tls server

#Tor Socks proxy
socks-proxy 127.0.0.1 9050

pull-filter ignore "route-ipv6"
pull-filter ignore "ifconfig-ipv6"
dhcp-option DNS 8.8.8.8
auth-user-pass vpnauth
compress
verb 1
reneg-sec 0

But the issue i am getting with this is that when i try to connect with the socks line in the openvpn config it keeps erroring out with the following error:

recv_socks_reply: TCP port read timeout expired: Operation now in progress

On testing the tor socks port manually as well it ends up being timed out when the openvpn config has the socks line added.

But when removing the socks line from openvpn and letting it connect directly to the vpn ,the connection seems to work fine and along with that the Tor socks port connects fine as well when testing it directly.

I tried some routing for the openvpn config but wasnt successful. Is there any way to get this type of configuration up and running?

1 Answer 1

1

The resolution was pretty simple , due to running tor and openvpn both locally the tor data was also trying to go through openvpn when openvpn was enabled. And openvpn was trying to send all data through tor socks , thus causing this issue. It was simply resolved by adding the following in the openvpn config after the socks option:

up-delay
route bridgeip 255.255.255.255 defaultgateway

You can change the bridgeip to the bridge you are using or the tor guard ip , and the default gateway you can find on ubunut using by running:

route -n

I am still not sure about the security issues with this approach but seems to be working fine.

1
  • You can mark your own answer as correct and I suggest you do so.
    – Swangie
    Mar 11, 2021 at 19:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .