Hi everyone. I've setup an OpenVPN server on my NAS running Arch Linux and it's working well except for one issue. I would like my clients to be able to access the NAS via it's remote LAN IP (192.168.0.242). This is because some services are configured to listen only on certain interfaces and I'd prefer to not change these.
At the moment my clients can access the NAS via 10.8.0.1 and the NAS can access the clients through each 10.8.0.x IP. All internet traffic from the clients is successfully routed through the server and the clients can access all other machines on the remote (192.168.0.0) LAN.
Sorry if this a stupid question, it's just that last frustrating issue I need to tick off before it's working perfectly for my needs.
This is my OpenVPN server configuration:
local 192.168.0.242
port 1194
proto udp
dev tun
ca /etc/openvpn/server/ca.crt
cert /etc/openvpn/server/server.crt
key /etc/openvpn/server/server.key
dh /etc/openvpn/dh2048.pem
server 10.8.0.0 255.255.255.0
route 10.8.0.0 255.255.255.0
push "redirect-gateway def1"
push "route 10.8.0.0 255.255.255.0"
push "dhcp-option DNS 10.8.0.1"
push "dhcp-option DNS 8.8.8.8"
keepalive 10 120
tls-auth /etc/openvpn/server/ta.key 0
comp-lzo
user nobody
group nobody
persist-key
persist-tun
The only additional routing/forwarding I do is enabled by this:
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o enp3s0 -j MASQUERADE