3

I have a OpenVPN server hosted on a QNAP NAS. I am accessing it via Windows and Android OpenVPN Clients. The NAS and the OpenVPN work perfectly. The main IP address of the NAS server is 192.168.1.200 when I am inside the LAN. From Inside the Lan, I can access it without VPN on that IP Address without problem on both device types.

The VPN Server creates a subnet for the VPN clients in the 192.168.2.* range, with 192.168.2.1 being the NAS itself.

So when a computer inside the LAN, without VPN, accesses the NAS, I use the 1.200 address. Several software settings are linked to that address, for example shared drives under windows point to //192.168.1.200/folderShare

However, when I am outside of the LAN and access the network via VPN, this changes. While all other components on the network are accessible via their native IP address (192.168.1.*), the NAS can be accessed only via its VPN subnet address, 192.168.2.1. That means that for example a windows laptop that wants to access a shared folder on the NAS through LAN (w/o VPN) and through WAN (with VPN) needs to use 2 different IP Addresses for the same destination, depending on the situation. And this is the smallest issue. If I have different libraries in an application tied to the IP address of the resource, I need to maintain both of them (for example Lightroom images, Kodi media files etc).

How can I go around that? How can I make 192.168.1.200 a working destination for VPN/WAN and no VPN/LAN access? - All while keeping the internet access through VPN working of course? Can I use some routing rules on my dd-wrt router to route .1.131 to 2.1?

thanks!

1
  • 1
    Did you actually solve this problem? If not: there are several possibilities, the most likely one of them being that the NAS defends itself from remote access, allowing access only from within the lan. This can be fixed by changing the netmask of the NAS (using a static IP) to 255.255.252.0, or, if you will, to 192.168.0.0./22 (no mistake here!). Jun 28, 2016 at 7:47

1 Answer 1

1

This is expected behaviour.

Either disable the gateway setting on the VPN connection, don't use the VPN while in your internal network, or have 2 connections.

You have not mentioned what OS your devices use, so I'll assume Windows. To disable the gateway setting, go to your network connection, choose Change adapter settings, Right click your VPN connection and choose: Properites.

Head to the tab Networking and double click the TCP/IPv4 item. Press Advanced... and uncheck Use default gateway on remote network.

What this does is, instead of forwarding every request through the VPN, it will attempt to connect to any network locally first, and if not found locally, then use the VPN tunnel.

EDIT based on the newly provided information:
I see what you mean now. If you can alter the ip configuration of your OpenVPN tunnel, make it give the following IP Address information:
IPAddress stays the same, submetmask: instead of using 255.255.255.0, use 255.255.253.0, which gives access to the following IP range: 192.168.0.x - 192.168.3.x

5
  • Thanks! I am not sure I understand everything. I do not use VPN when I am on the LAN. The issue persists on Win and Android. Also, the OpenVPN client does not have these settings. Let me try to clarify better above.
    – uncovery
    Jun 2, 2016 at 3:24
  • I've posted an edit with the newly given information.
    – LPChip
    Jun 2, 2016 at 5:20
  • Thanks for the update, do I need to do that on the VPN client config or the server?
    – uncovery
    Jun 2, 2016 at 5:24
  • On the Server, where the configuration is set that hands out ip addresses (DHCP server)
    – LPChip
    Jun 2, 2016 at 5:24
  • Seems this is complicated since the QNAP server writes mint config files with the 255 netmask on every start/reload. Will see if I can change that. Otherwise I have to bite the bullet and install OpenVPN on my router which is far less noob-friendly than on the QNAP.
    – uncovery
    Jun 2, 2016 at 7:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .