Hi guys,
I'm having trouble to setup an openvpn connection with my TL-WR902AC running on openwrt.
What I want to achieve:
- Provide a Wifi network, which leads all traffic to a VPN server. So my TL-WR902AC should act as an access point, which runs a VPN client and route all wifi data through the VPN tunnel.
What I did:
- Flashed the TL-WR902AC with OpenWrt
- Changed the static address (192.168.1.1) to DHCP. --> So when connecting the WR902AC with a LAN cable to my router, it retrieves a local IP address and I can reach the Luci Interface.
- Downloaded and installed OpenVPN and the Luci Interface for it
- Created a Wifi network, which I can connect to. The connected clients get local IP addresses from my main router, as it was meant to be.
- Created a new OpenVPN client by uploading the config file I exported from my VPN server. (If I use this config file and use it unchanged in the openvpn app on my iphone, the tunnel works fine and all traffic runs through VPN).
- Created a new interface 'vpnclient', unmanaged and with device 'tun0'.
- Changed the new interface 'vpnclient', so I created a new firewall zone on the firewall tab called 'vpnclient'.
- Then in the firewall section (Network->Firewall) I have the zones LAN(green) => WAN(red), WAN(red) and vpnclient(green). I have edited the zone LAN=>WAN and add 'vpnclient' to the "allow forward to destination zones" dropdown. So it now says LAN=>WAN & vpnclient.
- I checked the checkbox 'masquerading' also for vpnclient (it was already checked for WAN).
- I did not change anything in my ovpn config file, except of I have added username and password to the text box and in the ovpn editor I added the path behind 'auth-user-pass'. (Just as question right now: Do I have to change the line 'dev tun' to 'dev tun0'?)
My issues:
- When I have done all steps above and when I press 'start' on my openvpn connection, nothing happens.
- When I check the checkbox 'enable' and press save, the TL-WR902AC is connecting to the VPN server (I can see that on my VPN server side), but I can't open Luci anymore. So I'm totally locked out of my TL-WR902AC. When I unplug and plug it again, I can connect for a millisecond, but as the VPN connection is being set up automatically, I'm locked immediately again.
- Even the TL-WR902AC is now connected to the VPN server, it unfortunately doesn't seem to tunnel all traffic through the VPN connection, as I do not have the IP address of the VPN server gateway. I still have the VPN address of the location I'm using the TL-WR902AC VPN.
Question:
- How do I manage to be able to open Luci, even I have started my VPN? I have to reflash my device, as I can never manage my device anymore.
- What do I miss out to route all traffic through my VPN tunnel?
- When I use the iphone app with the exact same ovpn config file, it is working fine. After connecting I can see, that I have the IP address of the internet connection behind the VPN server.
Experts, I'm quite stucked and hope anyone of you could help me out of trouble!
Forgot to say: All openvpn config I have got from this video:
Thank you & best regards,
Arne