Good morning, I am installing a VPN server in such a way that I have two virtual machines, one of them has the OpenVPN service and the other has an Apache service running, both machines are in the same network segment 10.8.0.1 ( VPN) and 10.8.0.3 (Apache) the Apache virtual machine does not have Internet access while VPN does, we have a static address and a redirected port on the Router.
This is our configuration of the server.conf file:
dev tun
proto udp
port 1194
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/vpn.crt
key /etc/openvpn/easy-rsa/keys/vpn.key
dh /etc/openvpn/easy-rsa/keys/dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig 10.8.0.1 10.8.0.2
push "route 10.8.0.1 255.255.255.255"
push "route 10.8.0.0 255.255.255.0"
push "route 192.168.1.220 255.255.255.0"
push "redirect-gateway def1"
client-to-client
duplicate-cn
keepalive 10 120
tls-auth /etc/openvpn/easy-rsa/keys/ta.key 0
cipher AES-256-CBC
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status /var/log/openvpn-status.log 20
log /var/log/openvpn.log
verb1
When establishing a VPN connection from the client, either Windows or OSx connects us perfectly, even navigates on the Internet from this new public IP, but nevertheless is unable to ping the machine that has Apache and that thanks to the VPN it is already within its own network. It's as if OpenVPN every time someone connects to make small subnets, since the network mask that assigns the client is always 255.255.255.252