Hello everyone,
Sorry if I post in the wrong category or if I post somehow the same question, I am new to this forum and new to OpenVPN. Pease link me to an existing thread if one exists, that describes the same problem. Thank you!!!!!
I am trying to set up a site to site connection using OpenVPN. At the end it will be more locations (1 server with more clients), and the IPs will change. This are only untill I get it work.. 😉
Network setup:
Location A. Subnet 192.168.10.0/32 - VPN Server 192.168.10.201 - VPN IP 10.25.0.1
Location B. Subnet 192.168.20.0/32 - VPN Client B 192.168.20.200
Future locations:
Location C. Subnet 192.168.30.0/32 - VPN Client C 192.168.30.200
Location D. Subnet 192.168.40.0/32 - VPN Client D 192.168.40.200
I have followed this links:
https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-16-04#step-13-test-your-vpn-connection
http://dnaeon.github.io/static-ip-addresses-in-openvpn
https://community.openvpn.net/openvpn/wiki/RoutedLans
to setup my openvpn server, set static IP for clients and routing clients .
Here is my server configuration:
#################################################
# Server Configuration #
#################################################
#local 192.168.10.201
port MY_PORT
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key # This file should be kept secret
dh dh2048.pem
server 10.25.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
client-config-dir ccd
route 192.168.20.0 255.255.255.0 101
push "route 192.168.10.0 255.255.255.0"
push "route 192.168.20.0 255.255.255.0"
client-to-client
keepalive 10 120
tls-auth ta.key 0 # This file is secret
key-direction 0
cipher AES-256-CBC # AES
auth SHA512
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status status.log
log logfile.log
verb 6
Client configuration - Location B:
##############################################
# Client B
##############################################
client
dev tun
proto udp
remote MY_SERVER_IP MY_PORT
resolv-retry infinite
nobind
user nobody
group nogroup
persist-key
persist-tun
remote-cert-tls server
cipher AES-256-CBC
auth SHA512
key-direction 1
comp-lzo
verb 3
mute 20
script-security 2
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf
Clinent Config File (under client-config-dir ccd)
iroute 192.168.20.0 255.255.255.0
ifconfig-push 10.25.0.30 10.25.0.1
Both routers have rounting rules (described below, Destination Network -> Mask -> Default Gateway).
Location A:
192.168.20.0 -> 255.255.255.0 -> 192.168.10.201
10.25.0.0 -> 255.255.255.0 -> 192.168.10.201
Location B:
192.168.10.0 -> 255.255.255.0 -> 192.168.20.200
10.25.0.0 -> 255.255.255.2 -> 192.168.20.200
My Problem is, I cannot access the server and none of the local PCs (Location A) from the other network (location B), I tried also to trace the route but it does not route furthure than the Client PC (192.168.20.200). The Client is connecting and can acces the server and other PCs (share, web server, etc).
I want also that every pc is connecting to the internet from its local network (server and client PCs also), and only data trasfered to/between different locations should go over the VPN... Like if I what to acces a share on a different LAN, I only need to acces the IP address/FolderName in the file browser (e.g. My PC is 192.168.10.x and I want to access a share from 192.168.20.y, or vice-versa).
What am I doing wrong, what am I missing, how can I get this to work?
Thank you in Advance!