Hi everyone,
I finished so all tasks with OVPN. You can mark as solved this topic.
I have at now all i want working fine. Thks
TinCanTech for your time, help and patience.
I solved all my problems with your help. Have now server working fine and 2 clients working perfect at the same time:
Work place PC - connected behind a proxy just for using my home PC as local (shares, RDP...)
Android Phone connected routing all traffic through VPN for using home internet connection and shares.
I want to share all configs i have done just in case it helps other people:
First of all say that i dont set up
any static route, in my case was not necessary. In order to give access to my network i just share my internet connection at home. (I have an ethernet card only and a tun virtual nic)
I assum you have created all certs and keys you will need (take care to select a
different common name for each client cert when prompted
build-ca client) So now just left copy each client certs on each client.
My server config says:
# Which local IP address should OpenVPN
# listen on? (optional)
local 0.0.0.0
# Which TCP/UDP port should OpenVPN listen on?
port xxxxx (port number to connect to)
# TCP or UDP server?
proto tcp (i use tcp for accessing behind a proxy, but recommended and much better UDP protocol if possible)
# "dev tun" will create a routed IP tunnel,
# "dev tap" will create an ethernet tunnel.
dev tun
ca ca.crt
cert server.crt
key server.key
client-config-dir yourclientsdir (if wanted)
# Diffie hellman parameters.
# Generate your own with:
# openssl dhparam -out dh2048.pem 2048
dh dh2048.pem (recommended 2048, have to modify key_length in vars file before building dh)
tls-auth ta.key 0 (for more security)
# Configure server mode and supply a VPN subnet
server 10.0.1.0 255.255.255.0 (vpn subnet as you wish)
# Maintain a record of client <-> virtual IP address
ifconfig-pool-persist ipp.txt
push "route 10.0.0.0 255.255.255.0" (home lan subnet)
keepalive 10 120
# Select a cryptographic cipher.
# This config item must be copied to
# the client config file as well.
cipher AES-256-CBC
comp-lzo
# The persist options will try to avoid
# accessing certain resources on restart
# that may no longer be accessible because
# of the privilege downgrade.
persist-key
persist-tun
# Output a short status file showing
# current connections, truncated
# and rewritten every minute.
status openvpn-status.log
# Set the appropriate level of log
# file verbosity.
#
# 0 is silent, except for fatal errors
# 4 is reasonable for general usage
# 5 and 6 can help to debug connection problems
# 9 is extremely verbose
verb 4
My work place PC client connects only to home lan through VPN (shares, RDP...) Internet at work:
client
dev tun
proto tcp
remote OpenVPNServerPublicIP Port
resolv-retry infinite
nobind
persist-key
persist-tun
#Proxy config
http-proxy-option VERSION 1.1
http-proxy proxy.domain.name port auth.file basic
ca ca.crt
cert client.crt
key client.key
cipher AES-256-CBC
remote-cert-tls server
tls-auth ta.key 1
comp-lzo
verb 4
Android Client redirects all traffic through VPN, config says:
client
dev tun
proto tcp
remote OpenVPNServerPublicIP Port
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert Androidclient.crt
key Androidclient.key
remote-cert-tls server
tls-auth ta.key 1
cipher AES-256-CBC
comp-lzo
verb 4
For this to work i have needed to
create a dir .\openvpn\config\clients folder and inside it create a file (without extension) saying:
push "redirect-gateway def1"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
And added a line in server.ovpn config file
client-config-dir yourclientsdir
And that is all i have done.
I hope it helps other people.
Thank you very much for your help.
OpenVPN is the best i tried! Cheers!
Elmo