I have network setup as below. My goal is to connect from client 2 to devices in the same LAN with client 1.
+-----------------+
| Router |
+-----------------+
|
| LAN 192.168.0.0
|---------|--------|
| |
+----------------+ +---------+ +----------------+
|OpenVPN client 1| | Node 1 | |OpenVPN client 2|
+----------------+ +---------+ +----------------+
10.8.0.11 10.8.0.5
My server.conf is as below
client-config-dir ccd
port 1194
proto udp
dev tun
sndbuf 0
rcvbuf 0
ca ca.crt
cert server.crt
key server.key
dh dh.pem
auth SHA512
tls-auth ta.key 0
topology subnet
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
route 192.168.0.0 255.255.255.0
push "route 192.168.0.0 255.255.255.0"
client-to-client
keepalive 10 120
cipher AES-256-CBC
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
verb 5
crl-verify crl.pem
There is a ccd file for client 1 in the ccd folder
iroute 192.168.0.0 255.255.255.0
I've also edited routing table of the router to redirect requests to 10.8.0.0 - > LAN IP of the client 1.
Normally this should be enough to make things work but for some reason route table on OpenVPN doesn't seem to be correct.
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default ip-172-26-0-1.a 0.0.0.0 UG 0 0 0 eth0
10.8.0.0 * 255.255.255.0 U 0 0 0 tun0
172.26.0.0 * 255.255.240.0 U 0 0 0 eth0
192.168.0.0 ip-10-8-0-2.ap- 255.255.255.0 UG 0 0 0 tun0
Here requests to 192.168.0.0 are routed to 10.8.0.2 instead of 10.8.0.11. As of now I can access client 1 both by VPN IP and LAN IP from client 2 but any other device on LAN is not reachable from client 2. What am I doing wrong?