I have the following setup:
- - Router with LAN IP address of 192.168.1.1
- All (W)LAN connected devices get an IP in the range 192.168.1.0/24
- OpenVPN server is running ON the router which exposes the 172.16.36.0/24 subnet
- A Synology NAS with LAN IP 192.168.1.2, connected to TorGuard VPN on the subnet 10.8.0.0/24
- The NAS has (because of this VPN connection) a default gateway of 10.9.1.1 (or something) --> this is what causing the problem
When I connect to the OpenVPN server I have access to my router by going to 192.168.1.1, but when I try to connect to the Synology NAS at 192.168.1.2 I'm not able to get a response. When I disconnect the NAS from the TorGuard VPN, I am able to connect to it through the OpenVPN connection.
This is my server config:
daemon
topology subnet
server 172.16.36.0 255.255.255.0
proto udp
rcvbuf 0
sndbuf 0
port 1194
dev tun21
cipher AES-256-CBC
comp-lzo adaptive
keepalive 15 60
verb 3
push "route 192.168.1.0 255.255.255.0"
duplicate-cn
push "dhcp-option DNS 192.168.1.1"
push "redirect-gateway def1"
plugin /usr/lib/openvpn-plugin-auth-pam.so openvpn
duplicate-cn
ca ca.crt
dh dh.pem
cert server.crt
key server.key
status-version 2
status status 10
My client config is this:
client
dev tun
proto udp
remote xxx.xxx.xxx.xxx 1194
float
cipher AES-256-CBC
comp-lzo adaptive
keepalive 15 60
auth-user-pass
ns-cert-type server
<ca>
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
</ca>
<cert>
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
-----END PRIVATE KEY-----
</key>
resolv-retry infinite
nobind
Does this have something to do with routing back from the NAS to the connected client through OpenVPN? My guess is that it has, but I don't know where to look to solve this. I tried adding a static route on my NAS that routes 172.16.36.0 255.255.255.0 through the 192.168.1.1 gateway but this didn't work. I'm really stuck here.