I've a problem setting my openvpn server. Actually I have a server with ubuntu server 14.04 with a public IP. On this machine I have some services that need to be accessed only using the VPN. Also I have a regoular laptop in the same LAN that need to be accessed only from the VPN. So I need a configuration for OpenVPN that allows me to access only the server and the laptop AND NOT internet. So what I've done so far is this:
Server configuration:
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 192.168.0.20 255.255.255.255"
push "redirect-gateway def1 bypass-dhcp"
client-to-client
keepalive 10 120
tls-auth ta.key 0
cipher AES-256-CBC
persist-key
persist-tun
status openvpn-status.log
verb 3
explicit-exit-notify 1
(192.168.0.20 is laptop's ip)
Client configuration:
client
dev tun
proto udp
remote <server-public-ip> 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert tester.crt
key tester.key
remote-cert-tls server
tls-auth ta.key 1
cipher AES-256-CBC
verb 3
auth-user-pass
auth-nocache
If I launch "route -n" I have this sub-set related to openvpn:
10.8.0.0 10.8.0.2 255.255.255.0 UG 0 0 0 tun0
10.8.0.2 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
So when I access the VPN, I can access the server via 10.8.0.1 but can't access the laptop. I've tested changing the push route using: push "route 192.168.0.20 255.255.255.255 10.8.0.2 1" but still 10.8.0.2 it's not accessible. UFW is also disabled.
I tried enabling ip_forward on sysctl but it's not helping (a part from allowing internet access that I don't want).
Thanks for any help you will provide me.