Running OPENVPN client (through VPN provider) with Apache Webserver - Ubuntu 16.04

This forum is for general conversation and user-user networking.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
chefboyct
OpenVpn Newbie
Posts: 3
Joined: Tue Jul 04, 2017 9:17 am

Running OPENVPN client (through VPN provider) with Apache Webserver - Ubuntu 16.04

Post by chefboyct » Tue Jul 04, 2017 9:43 am

Hi all,

I am quite new to this forum and also VPN and it is really quite confusing for me. and I have tried to figure this out while googling until 4am and still no viable solution. I hope this is allowed in this forum seeing it is more than OPENVPN related.

I have Zorin 12 16.04 and Nextcloud 12 and I could access my nextcloud server inside and outside my network.

Now the next step is I have access to TigerVPN (not advertising for them at all!) and I used openvpn --config GB London.ovpn for that matter - script below

client
remote lon.tigervpn.com 1194 udp
remote lon.tigervpn.com 443 tcp-client
pull
auth-user-pass auth.txt
comp-lzo adaptive
ca ca.crt
dev tun
tls-client
script-security 2
cipher AES-256-CBC
mute 10

route-delay 5
redirect-gateway def1
resolv-retry infinite

dhcp-renew
dhcp-release
persist-key
persist-tun
remote-cert-tls server
mssfix

Since I activated OPENVPN as client, I can no longer access nextcloud inside and outside the network once cron update the IP address via FREEDNS (free domain). And Webserver / nextcloud and OpenVPN are all running on one machine (purpose for VPN is to run torrent on the same machine)

So let me try and draw a picture here below -

Nexcloud Server (Internal 1.0.0.3) --> Router (Gateway 1.0.0.1) --> External DYN IP by ISP (111.222.111.222) --> TigerVPN London Server (185.20.99.139) --> IP by TigerVPN (185.20.99.199) --> FREEDNS IP (Without VPN 111.222.111.222 and with VPN activated 185.20.99.199)

while rest of the PC on the same network would use External IP set by ISP 111.222.111.222 to access the internet and so on. And I understand it makes perfect sense if VPN is deactivated and all the network will run as the traffic all go through router gateway 1.0.0.1. The question is... what can I do to change the routing or forwarding with VPN up and running so it can direct the traffic and understood by my Apache2 / nextcloud?

Thanks for your help in advance.

Brad

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Running OPENVPN client (through VPN provider) with Apache Webserver - Ubuntu 16.04

Post by TinCanTech » Tue Jul 04, 2017 10:45 am

Not sure I understand what you want but ..
chefboyct wrote:The question is... what can I do to change the routing or forwarding with VPN up and running so it can direct the traffic and understood by my Apache2 / nextcloud?
Add a route for your apache server via your local gateway not the VPN ..

chefboyct
OpenVpn Newbie
Posts: 3
Joined: Tue Jul 04, 2017 9:17 am

Re: Running OPENVPN client (through VPN provider) with Apache Webserver - Ubuntu 16.04

Post by chefboyct » Tue Jul 04, 2017 1:14 pm

TinCanTech wrote:Not sure I understand what you want but ..
chefboyct wrote:The question is... what can I do to change the routing or forwarding with VPN up and running so it can direct the traffic and understood by my Apache2 / nextcloud?
Add a route for your apache server via your local gateway not the VPN ..
Hi @TinCanTech, thankos for the reply. The question is... how do I do know? I will probably need to use iptables to do it but I am really not sure where to start. It would be great if you can point me to the right direction. Thanks a mil!

Post Reply