Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I hope this is the correct place to post this.

Basically i'm trying to run vpn through a socks proxy. Now this works fine in Windows 7 for me but when i try it in Linux it fails with

Code:
Mon Jun 17 23:26:26 2013 [<redacted>] Inactivity timeout (--ping-restart), restarting
Mon Jun 17 23:26:26 2013 SIGUSR1[soft,ping-restart] received, process restarting
Mon Jun 17 23:26:26 2013 Restart pause, 10 second(s)

I've tested with Ubuntu 12.x, 13.x and also Debian 7.0. I've tested with the default openvpn 2.2 from the repositories and by compiling 2.3. But i end up with the same error.

Here is my config file.

client
dev tun0
proto tcp
socks-proxy 127.0.0.1 9050
remote <redacted> 1194
resolv-retry infinite
nobind

auth-user-pass p.auth
auth-retry nointeract

ca [inline]

tls-client
tls-auth [inline]
ns-cert-type server

keepalive 10 30
cipher AES-256-CBC
# tls-ciphers currently disabled due to OpenVPN bug.     
# Will hopefully be re-enabled with version 2.3.2.
#tls-cipher TLSv1:!ADH:!SSLv2:!NULL:!EXPORT:!DES:!LOW:!MEDIUM:@STRENGTH
persist-key
persist-tun
comp-lzo
tun-mtu 1500
mssfix
verb 3

The full error message

Mon Jun 17 23:25:25 2013 ROUTE_GATEWAY 192.168.1.1/255.255.255.0 IFACE=eth0 HWADDR=00:0c:29:8c:91:9a
Mon Jun 17 23:25:25 2013 TUN/TAP device tun0 opened
Mon Jun 17 23:25:25 2013 TUN/TAP TX queue length set to 100
Mon Jun 17 23:25:25 2013 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Mon Jun 17 23:25:25 2013 /sbin/ifconfig tun0 46.246.35.126 netmask 255.255.255.0 mtu 1500 broadcast 46.246.35.255
Mon Jun 17 23:25:26 2013 /sbin/route add -net 127.0.0.1 netmask 255.255.255.255 gw 192.168.1.1
Mon Jun 17 23:25:26 2013 /sbin/route add -net 0.0.0.0 netmask 128.0.0.0 gw 46.246.35.1
Mon Jun 17 23:25:26 2013 /sbin/route add -net 128.0.0.0 netmask 128.0.0.0 gw 46.246.35.1
Mon Jun 17 23:25:26 2013 /sbin/route add -net 46.246.35.2 netmask 255.255.255.255 gw 192.168.1.1
Mon Jun 17 23:25:26 2013 Initialization Sequence Completed
Mon Jun 17 23:26:26 2013 [pw.openvpn.ipredator.se] Inactivity timeout (--ping-restart), restarting
Mon Jun 17 23:26:26 2013 SIGUSR1[soft,ping-restart] received, process restarting
Mon Jun 17 23:26:26 2013 Restart pause, 10 second(s)
Mon Jun 17 23:26:36 2013 Socket Buffers: R=[87380->131072] S=[16384->131072]
Mon Jun 17 23:26:36 2013 Attempting to establish TCP connection with [AF_INET]127.0.0.1:9050 [nonblock]
Mon Jun 17 23:26:36 2013 TCP connection established with [AF_INET]127.0.0.1:9050
Mon Jun 17 23:26:41 2013 recv_socks_reply: TCP port read timeout expired: Operation now in progress (errno=115)
Mon Jun 17 23:26:41 2013 /sbin/route del -net 46.246.35.2 netmask 255.255.255.255
Mon Jun 17 23:26:41 2013 /sbin/route del -net 127.0.0.1 netmask 255.255.255.255
Mon Jun 17 23:26:41 2013 /sbin/route del -net 0.0.0.0 netmask 128.0.0.0
Mon Jun 17 23:26:41 2013 /sbin/route del -net 128.0.0.0 netmask 128.0.0.0
Mon Jun 17 23:26:41 2013 Closing TUN/TAP interface
Mon Jun 17 23:26:41 2013 /sbin/ifconfig tun0 0.0.0.0
Mon Jun 17 23:26:43 2013 SIGTERM[soft,init_instance] received, process exiting

The routing table after connecting through socks.

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         46.246.35.1     128.0.0.0       UG    0      0        0 tun0
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
46.246.35.0     0.0.0.0         255.255.255.0   U     0      0        0 tun0
46.246.35.2     192.168.1.1     255.255.255.255 UGH   0      0        0 eth0
127.0.0.1       192.168.1.1     255.255.255.255 UGH   0      0        0 eth0
128.0.0.0       46.246.35.1     128.0.0.0       UG    0      0        0 tun0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0

Using Linux and socks is really essential to me and i'm really clueless about this issue. Any help would be greatly appreciated, thanks in advance!

share|improve this question
add comment

1 Answer

Is your proxy a SOCKS5 proxy? Or a SOCKS4 proxy?

I just had exactly the same problem, and nailed it down to the fact that (though undocumented), OpenVPN only supports a SOCKS5 proxy

FWIW, the SOCKS4 header is longer, and hence my proxy was waiting for additional data and timing out (TCP port read timeout expired) when OpenVPN connected.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.