Page 1 of 1

Access webserver from outside LAN

Posted: Wed Jan 13, 2016 12:38 am
by glik22
I'm running both a webserver and the openvpn client with private internet access on my raspberry pi. On my router I forwarded the port nginx is running on to my pi. When inside my LAN, I can access my server at <external_ip>:<port>. This doesn't work outside my LAN though.

I think I have to setup some ip table rules to get this working. A quick check with "iptables-save" shows that I have no rules setup. Anyone know how I can get this working?

Thanks.

Re: Access webserver from outside LAN

Posted: Wed Jan 13, 2016 10:25 am
by Traffic
glik22 wrote:'m running both a webserver and the openvpn client with private internet access on my raspberry pi
While using PIA, your Pi will have it's default gateway redirected.
glik22 wrote:When inside my LAN, I can access my server at <external_ip>:<port>. This doesn't work outside my LAN though
Because of PIA (above).
glik22 wrote:Anyone know how I can get this working
It depends what you need PIA for ..

Re: Access webserver from outside LAN

Posted: Wed Jan 13, 2016 4:09 pm
by glik22
I'd like to route all traffic through the VPN except for:
  • 1) Connections made to my pi from inside my lan. What I mean is going to <pi's internal ip>:<port>
    2) Connections made to <public ip>:<port of server>