Hi,
I', trying to set up the openvpn+obfsproxy environment, and currently, openvpn is working OK using proto UDP. The working scenario is openwrt of x86-generic(server side), and a PC running windows xp(client side). I did all the experiment in the VMWare 12.0.
However, when I follow the instructions on
https://community.openvpn.net/openvpn/wiki/TrafficObfuscation, the client couldn't connect to the server, the connection was always reset, saying that
Mon Aug 01 10:35:28 2016 Socket Buffers: R=[8192->8192] S=[8192->8192]
Mon Aug 01 10:35:28 2016 Attempting to establish TCP connection with [AF_INET]127.0.0.1:10194 [nonblock]
Mon Aug 01 10:35:28 2016 MANAGEMENT: >STATE:1470018928,TCP_CONNECT,,,
Mon Aug 01 10:35:28 2016 TCP connection established with [AF_INET]127.0.0.1:10194
Mon Aug 01 10:35:28 2016 recv_socks_reply: Socks proxy returned bad reply
Mon Aug 01 10:35:28 2016 SIGUSR1[soft,init_instance] received, process restarting
Mon Aug 01 10:35:28 2016 MANAGEMENT: >STATE:1470018928,RECONNECTING,init_instance,,
Mon Aug 01 10:35:28 2016 Restart pause, 5 second(s)
After I change the proto in client.ovpn(it was originally proto udp) to
proto tcp-client
it is still reset, although with different infomation
Mon Aug 01 10:39:28 2016 Socket Buffers: R=[8192->8192] S=[8192->8192]
Mon Aug 01 10:39:28 2016 Attempting to establish TCP connection with [AF_INET]127.0.0.1:10194 [nonblock]
Mon Aug 01 10:39:28 2016 MANAGEMENT: >STATE:1470019168,TCP_CONNECT,,,
Mon Aug 01 10:39:28 2016 TCP connection established with [AF_INET]127.0.0.1:10194
Mon Aug 01 10:39:28 2016 TCPv4_CLIENT link local: [undef]
Mon Aug 01 10:39:28 2016 TCPv4_CLIENT link remote: [AF_INET]127.0.0.1:10194
Mon Aug 01 10:39:28 2016 MANAGEMENT: >STATE:1470019168,WAIT,,,
Mon Aug 01 10:39:28 2016 Connection reset, restarting [0]
Mon Aug 01 10:39:28 2016 SIGUSR1[soft,connection-reset] received, process restarting
Mon Aug 01 10:39:28 2016 MANAGEMENT: >STATE:1470019168,RECONNECTING,connection-reset,,
Mon Aug 01 10:39:28 2016 Restart pause, 5 second(s)
Even if I stop the firewall, it still doesn't work. I doubt a problem in the configuration but I couldn't tell what is wrong as I'm not familiar with openvpn and obfsproxy.
Here is how I start obfsproxy:
In the Server side:
obfsproxy --log-file=obfsproxy.log --log-min-severity=info obfs2 \
--dest=127.0.0.1:1194 --shared-secret=whocares server 0.0.0.0:21194 &
and the Client side:
obfsproxy --log-file=obfsproxy.log --log-min-severity=info obfs2 \
--shared-secret=whocares socks 127.0.0.1:10194
Here is my server side configuration:
#/etc/config/openvpn
config openvpn 'myvpn'
option enabled '1'
option verb '3'
option port '1194'
option proto 'udp tcp'
option dev 'tun'
option server '10.8.0.0 255.255.255.0'
option ca '/etc/openvpn/ca.crt'
option cert '/etc/openvpn/my-server.crt'
option key '/etc/openvpn/my-server.key'
option dh '/etc/openvpn/dh2048.pem'
option push 'redirect-gateway def1 local' #to route all client traffic through the tunnel]
and the client side config
#client.ovpn
dev tun
proto udp
;Maybe the difference between TCP and UDP?
log openvpn.log
verb 3
ca ca.crt
cert my-client.crt
key my-client.key
client
remote-cert-tls server
remote 192.168.40.6 21194
socks-proxy-retry
socks-proxy 127.0.0.1 10194 #obfsproxy will listen on this port
Could anyone help me figure out what I missed? Thanks.
Tgn