Hey Guys, I need some help here.
I need to setup my OpenWrt to operate as a OpenVPN server (home network), so I can connect to my LAN devices while out of home.
My gateway to internet is my modem (192.168.15.1).
- OpenWrt is on 192.168.15.250
- The VPN server is on 10.10.0.1 | 192.168.15.250
- Port forward from modem to OpenWrt is OK
Before OpenWrt config, I setup the OpenVPN server on a Debian machine for testing and fine tuning. Everything was OK on Debian, and the only thing besides openvpn server configuration was iptables forwarding.
I imported the server.conf from Debian to OpenWrt, and changed port forwarding on my modem, the client successfully connected to OpenWrt, but traffic forwarding didnt worked. I cant ping/connect to internet or lan devices on 192.168.15.0/24. I tried to forward traffic with iptables, but no success.
push "route 192.168.15.0 255.255.255.0" push "redirect-gateway def1" comp-lzo client-to-client dev tun topology subnet server 10.10.0.0 255.255.255.0 #client-config-dir /usr/syno/etc/packages/VPNCenter/openvpn/ccd dh /etc/openvpn/server/keys/dh.pem ca /etc/openvpn/server/keys/ca.crt cert /etc/openvpn/server/keys/server.crt key /etc/openvpn/server/keys/server.key max-clients 5 persist-tun persist-key verb 5 #log-append /var/log/openvpn/openvpn.log keepalive 10 60 reneg-sec 0 duplicate-cn port 1194 cipher AES-256-CBC auth SHA512 proto udp4
iptables -t nat -A POSTROUTING -s 10.10.0.0/24 -o br-lan -j MASQUERADE