tunnel openVPN connection <-> proxy SOCKS

Need help configuring your VPN? Just post here and you'll get that help.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
willy87
OpenVPN User
Posts: 32
Joined: Tue Apr 26, 2016 8:09 pm

tunnel openVPN connection <-> proxy SOCKS

Post by willy87 » Thu May 12, 2016 9:55 pm

Hi guys! I would like to try to tunnel my openVPN connection over a SSH connection to be used for a proxy SOCKS.
I have:

-server.conf running on my dedicated VPS
-putty on my tunnel win work pc (it uses http proxy for surfing the web)
-client.ovpn for client device iphone

I read many tutorials and pages but the issue is not so easy.. Could you help me?

For example I only know that port 443 need to be used in putty to reach my VPS as tunnel SSH.
I don't know so wich port I may use for openvpn connection..protocol..

Can I estabilish a openvpn connection from my iphone (client) (thanks to openvpn official app) to my dedicated VPS (server) through putty work pc tunnelling? :?:

thanks guys to help my in this project!! :mrgreen: :mrgreen: :mrgreen:

pabischoff
OpenVpn Newbie
Posts: 3
Joined: Tue May 10, 2016 5:41 pm

Re: tunnel openVPN connection <-> proxy SOCKS

Post by pabischoff » Fri May 13, 2016 6:34 pm

I just wrote an article on this: https://www.comparitech.com/blog/vpn-pr ... sh-tunnel/

For more detailed troubleshooting you should post your configs and logs from server and client.

willy87
OpenVPN User
Posts: 32
Joined: Tue Apr 26, 2016 8:09 pm

Re: tunnel openVPN connection <-> proxy SOCKS

Post by willy87 » Fri May 13, 2016 9:34 pm

Hi! Thanks pabischoff!

looks here please

server

Code: Select all

port 1194
proto tcp-server
dev tun1
ifconfig 10.4.0.1 10.4.0.2
status server-tcp.log
verb 3
ca ca.crt
cert server.crt
key server.key 
dh dh2048.pem
client

Code: Select all

client 
remote localhost 1194
port 1194
dev tun1
redirect-gateway def1
ifconfig 10.4.0.2 10.4.0.1
socks-proxy-retry
socks-proxy 127.0.0.1 8080 
i receive from log this error:
option error:remote option not specified..
I tried to modify socks ip.. remote ip.. add "client" at begin but nothing..

Just for your info I already set in work pc the putty software with tunnel on port D8080 and for necessary HTTP proxy 8080 (same port)
I try with pc browser and if i set socks proxy localhost port 8080 i can surf correctly under tunnel. So puttytunnel is working fine.

We just need to set connection from client iphone (i use openvpn connect) and my dedicated VPS in debian where server.conf is running :)
Thanks for helping me..

If you have better idea to surf with my openVPN from my iphone i will really happyy!!!! :mrgreen: :mrgreen: :mrgreen:

willy87
OpenVPN User
Posts: 32
Joined: Tue Apr 26, 2016 8:09 pm

Re: tunnel openVPN connection <-> proxy SOCKS

Post by willy87 » Fri May 13, 2016 9:59 pm

EDIT: I write again client.ovpn and now should be ok.
But i cannot connect because i receive error regarding localhost
I try also to set

Code: Select all

socks-proxy-retry
socks-proxy 172.27.153.206 8080 
(172.27.153.206 is work pc ip where tunnel is on)

thanks for helping guyss


log

Code: Select all

OpenVPN Start -----
OpenVPN core 3.0 ios armv7s thumb2 32-bit
2016-05-13 23:54:05 UNUSED OPTIONS
5 [ifconfig] [10.4.0.2] [10.4.0.1]
6 [socks-proxy-retry]
7 [socks-proxy] [172.27.153.206] [8080]
8 [set] [CLIENT_CERT] [0]

2016-05-13 23:54:05 EVENT: RESOLVE
2016-05-13 23:54:05 Contacting [::1]:1194 via TCP
2016-05-13 23:54:05 EVENT: WAIT
2016-05-13 23:54:05 SetTunnelSocket returned 1
2016-05-13 23:54:05 Transport Error: TCP connect error on 'localhost:1194' ([::1]:1194): Connection refused
2016-05-13 23:54:05 Client terminated, restarting in 2...
2016-05-13 23:54:07 EVENT: RECONNECTING
2016-05-13 23:54:07 Contacting 127.0.0.1:1194 via TCP
2016-05-13 23:54:07 EVENT: WAIT
2016-05-13 23:54:07 SetTunnelSocket returned 1
2016-05-13 23:54:07 Transport Error: TCP connect error on 'localhost:1194' (127.0.0.1:1194): Connection refused
2016-05-13 23:54:07 Client terminated, restarting in 2...
2016-05-13 23:54:09 EVENT: RECONNECTING
2016-05-13 23:54:09 EVENT: RESOLVE
2016-05-13 23:54:09 Contacting [::1]:1194 via TCP
2016-05-13 23:54:09 EVENT: WAIT
2016-05-13 23:54:09 SetTunnelSocket returned 1
2016-05-13 23:54:09 Transport Error: TCP connect error on 'localhost:1194' ([::1]:1194): Connection refused
2016-05-13 23:54:09 Client terminated, restarting in 2...
2016-05-13 23:54:11 EVENT: RECONNECTING
2016-05-13 23:54:11 Contacting 127.0.0.1:1194 via TCP
2016-05-13 23:54:11 EVENT: WAIT
2016-05-13 23:54:11 SetTunnelSocket returned 1
2016-05-13 23:54:11 Transport Error: TCP connect error on 'localhost:1194' (127.0.0.1:1194): Connection refused
2016-05-13 23:54:11 Client terminated, restarting in 2...
2016-05-13 23:54:13 EVENT: RECONNECTING
2016-05-13 23:54:13 EVENT: RESOLVE
2016-05-13 23:54:13 Contacting [::1]:1194 via TCP
2016-05-13 23:54:13 EVENT: WAIT
2016-05-13 23:54:13 SetTunnelSocket returned 1
2016-05-13 23:54:13 Transport Error: TCP connect error on 'localhost:1194' ([::1]:1194): Connection refused
2016-05-13 23:54:13 Client terminated, restarting in 2...
2016-05-13 23:54:15 EVENT: RECONNECTING
2016-05-13 23:54:15 Contacting 127.0.0.1:1194 via TCP
2016-05-13 23:54:15 EVENT: WAIT
2016-05-13 23:54:15 SetTunnelSocket returned 1
2016-05-13 23:54:15 Transport Error: TCP connect error on 'localhost:1194' (127.0.0.1:1194): Connection refused
2016-05-13 23:54:15 Client terminated, restarting in 2...
2016-05-13 23:54:17 EVENT: RECONNECTING
2016-05-13 23:54:17 EVENT: RESOLVE
2016-05-13 23:54:17 Contacting [::1]:1194 via TCP
2016-05-13 23:54:17 EVENT: WAIT
2016-05-13 23:54:17 SetTunnelSocket returned 1
2016-05-13 23:54:17 Transport Error: TCP connect error on 'localhost:1194' ([::1]:1194): Connection refused
2016-05-13 23:54:17 Client terminated, restarting in 2...
2016-05-13 23:54:19 EVENT: RECONNECTING
2016-05-13 23:54:19 Contacting 127.0.0.1:1194 via TCP
2016-05-13 23:54:19 EVENT: WAIT
2016-05-13 23:54:19 SetTunnelSocket returned 1
2016-05-13 23:54:19 Transport Error: TCP connect error on 'localhost:1194' (127.0.0.1:1194): Connection refused
2016-05-13 23:54:19 Client terminated, restarting in 2...
2016-05-13 23:54:21 EVENT: RECONNECTING
2016-05-13 23:54:21 EVENT: RESOLVE
2016-05-13 23:54:21 Contacting [::1]:1194 via TCP
2016-05-13 23:54:21 EVENT: WAIT
2016-05-13 23:54:21 SetTunnelSocket returned 1
2016-05-13 23:54:21 Transport Error: TCP connect error on 'localhost:1194' ([::1]:1194): Connection refused
2016-05-13 23:54:21 Client terminated, restarting in 2...
2016-05-13 23:54:23 EVENT: RECONNECTING
2016-05-13 23:54:23 Contacting 127.0.0.1:1194 via TCP
2016-05-13 23:54:23 EVENT: WAIT
2016-05-13 23:54:23 SetTunnelSocket returned 1
2016-05-13 23:54:23 Transport Error: TCP connect error on 'localhost:1194' (127.0.0.1:1194): Connection refused
2016-05-13 23:54:23 Client terminated, restarting in 2...
2016-05-13 23:54:25 EVENT: RECONNECTING
2016-05-13 23:54:25 EVENT: RESOLVE
2016-05-13 23:54:25 Contacting [::1]:1194 via TCP
2016-05-13 23:54:25 EVENT: WAIT
2016-05-13 23:54:25 SetTunnelSocket returned 1
2016-05-13 23:54:25 Transport Error: TCP connect error on 'localhost:1194' ([::1]:1194): Connection refused
2016-05-13 23:54:25 Client terminated, restarting in 2...
2016-05-13 23:54:27 EVENT: RECONNECTING
2016-05-13 23:54:27 Contacting 127.0.0.1:1194 via TCP
2016-05-13 23:54:27 EVENT: WAIT
2016-05-13 23:54:27 SetTunnelSocket returned 1
2016-05-13 23:54:27 Transport Error: TCP connect error on 'localhost:1194' (127.0.0.1:1194): Connection refused
2016-05-13 23:54:27 Client terminated, restarting in 2...
2016-05-13 23:54:29 EVENT: RECONNECTING
2016-05-13 23:54:29 EVENT: RESOLVE
2016-05-13 23:54:29 Contacting [::1]:1194 via TCP
2016-05-13 23:54:29 EVENT: WAIT
2016-05-13 23:54:29 SetTunnelSocket returned 1
2016-05-13 23:54:29 Transport Error: TCP connect error on 'localhost:1194' ([::1]:1194): Connection refused
2016-05-13 23:54:29 Client terminated, restarting in 2...
2016-05-13 23:54:31 EVENT: RECONNECTING
2016-05-13 23:54:31 Contacting 127.0.0.1:1194 via TCP
2016-05-13 23:54:31 EVENT: WAIT
2016-05-13 23:54:31 SetTunnelSocket returned 1
2016-05-13 23:54:31 Transport Error: TCP connect error on 'localhost:1194' (127.0.0.1:1194): Connection refused
2016-05-13 23:54:31 Client terminated, restarting in 2...
2016-05-13 23:54:33 EVENT: RECONNECTING
2016-05-13 23:54:33 EVENT: RESOLVE
2016-05-13 23:54:33 Contacting [::1]:1194 via TCP
2016-05-13 23:54:33 EVENT: WAIT
2016-05-13 23:54:33 SetTunnelSocket returned 1
2016-05-13 23:54:33 Transport Error: TCP connect error on 'localhost:1194' ([::1]:1194): Connection refused
2016-05-13 23:54:33 Client terminated, restarting in 2...
2016-05-13 23:54:35 EVENT: RECONNECTING
2016-05-13 23:54:35 Contacting 127.0.0.1:1194 via TCP
2016-05-13 23:54:35 EVENT: WAIT
2016-05-13 23:54:35 SetTunnelSocket returned 1
2016-05-13 23:54:35 Transport Error: TCP connect error on 'localhost:1194' (127.0.0.1:1194): Connection refused
2016-05-13 23:54:35 Client terminated, restarting in 2...
2016-05-13 23:54:37 EVENT: RECONNECTING
2016-05-13 23:54:37 EVENT: RESOLVE
2016-05-13 23:54:37 Contacting [::1]:1194 via TCP
2016-05-13 23:54:37 EVENT: WAIT
2016-05-13 23:54:37 SetTunnelSocket returned 1
2016-05-13 23:54:37 Transport Error: TCP connect error on 'localhost:1194' ([::1]:1194): Connection refused
2016-05-13 23:54:37 Client terminated, restarting in 2...
2016-05-13 23:54:39 EVENT: RECONNECTING
2016-05-13 23:54:39 Contacting 127.0.0.1:1194 via TCP
2016-05-13 23:54:39 EVENT: WAIT
2016-05-13 23:54:39 SetTunnelSocket returned 1
2016-05-13 23:54:39 Transport Error: TCP connect error on 'localhost:1194' (127.0.0.1:1194): Connection refused
2016-05-13 23:54:39 Client terminated, restarting in 2...
2016-05-13 23:54:41 EVENT: RECONNECTING
2016-05-13 23:54:41 EVENT: RESOLVE
2016-05-13 23:54:41 Contacting [::1]:1194 via TCP
2016-05-13 23:54:41 EVENT: WAIT
2016-05-13 23:54:41 SetTunnelSocket returned 1
2016-05-13 23:54:41 Transport Error: TCP connect error on 'localhost:1194' ([::1]:1194): Connection refused
2016-05-13 23:54:41 Client terminated, restarting in 2...
2016-05-13 23:54:43 EVENT: RECONNECTING
2016-05-13 23:54:43 Contacting 127.0.0.1:1194 via TCP
2016-05-13 23:54:43 EVENT: WAIT
2016-05-13 23:54:43 SetTunnelSocket returned 1
2016-05-13 23:54:43 Transport Error: TCP connect error on 'localhost:1194' (127.0.0.1:1194): Connection refused
2016-05-13 23:54:43 Client terminated, restarting in 2...
2016-05-13 23:54:45 EVENT: RECONNECTING
2016-05-13 23:54:45 EVENT: RESOLVE
2016-05-13 23:54:45 Contacting [::1]:1194 via TCP
2016-05-13 23:54:45 EVENT: WAIT
2016-05-13 23:54:45 SetTunnelSocket returned 1
2016-05-13 23:54:45 Transport Error: TCP connect error on 'localhost:1194' ([::1]:1194): Connection refused
2016-05-13 23:54:45 Client terminated, restarting in 2...
2016-05-13 23:54:47 EVENT: RECONNECTING
2016-05-13 23:54:47 Contacting 127.0.0.1:1194 via TCP
2016-05-13 23:54:47 EVENT: WAIT
2016-05-13 23:54:47 SetTunnelSocket returned 1
2016-05-13 23:54:47 Transport Error: TCP connect error on 'localhost:1194' (127.0.0.1:1194): Connection refused
2016-05-13 23:54:47 Client terminated, restarting in 2...
2016-05-13 23:54:49 EVENT: RECONNECTING
2016-05-13 23:54:49 EVENT: RESOLVE
2016-05-13 23:54:49 Contacting [::1]:1194 via TCP
2016-05-13 23:54:49 EVENT: WAIT
2016-05-13 23:54:49 SetTunnelSocket returned 1
2016-05-13 23:54:49 Transport Error: TCP connect error on 'localhost:1194' ([::1]:1194): Connection refused
2016-05-13 23:54:49 Client terminated, restarting in 2...
2016-05-13 23:54:51 EVENT: RECONNECTING
2016-05-13 23:54:51 Contacting 127.0.0.1:1194 via TCP
2016-05-13 23:54:51 EVENT: WAIT
2016-05-13 23:54:51 SetTunnelSocket returned 1
2016-05-13 23:54:51 Transport Error: TCP connect error on 'localhost:1194' (127.0.0.1:1194): Connection refused
2016-05-13 23:54:51 Client terminated, restarting in 2...
2016-05-13 23:54:53 EVENT: RECONNECTING
2016-05-13 23:54:53 EVENT: RESOLVE
2016-05-13 23:54:53 EVENT: DISCONNECTED
2016-05-13 23:54:53 Raw stats on disconnect:
TCP_CONNECT_ERROR : 24
N_RECONNECT : 24
2016-05-13 23:54:53 Performance stats on disconnect:
CPU usage (microseconds): 122549
Network bytes per CPU second: 0
Tunnel bytes per CPU second: 0
2016-05-13 23:54:53 ----- OpenVPN Stop -----

pabischoff
OpenVpn Newbie
Posts: 3
Joined: Tue May 10, 2016 5:41 pm

Re: tunnel openVPN connection <-> proxy SOCKS

Post by pabischoff » Mon May 16, 2016 10:47 pm

I could be wrong but I think you need to set your cert, secret, and ca files in your client config the same way as your server config, and make sure those files are in your config directory:
ca ca.crt
cert server.crt
key server.key
That might be why it's rejecting the connection. You can also try appending the contents of those files to the end of the client config: https://forum.pfsense.org/index.php?topic=86914.0

A server log would help.

Post Reply