OpenVPN server IP access

This forum is for admins who are looking to build or expand their OpenVPN setup.
Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
snikkelonius
OpenVpn Newbie
Posts: 1
Joined: Mon Sep 27, 2021 5:17 pm

OpenVPN server IP access

Post by snikkelonius » Mon Sep 27, 2021 5:49 pm

I'm running an OpenVPN server on a Synology NAS that has IP 192.168.1.10. This server also hosts a DNS server on the same IP.
After I've connected with a OpenVPN client to the server, the client is assigned 10.8.0.10 for the VPN tunnel. All IP's in the 192.168 range are still accessible, except for 192.168.1.10, which is a problem for me, because that's the IP that's configured in the client as the DNS server. So basically addresses cannot be resolved.

How can I configure the client or server so that the original server IP is still routed to the VPN/DNS server? If I connect to my router and forward the VPN connection from the router to the VPN server everything works fine, but I'd like to connect directly to the VPN server when I'm directly connected to my LAN.

When I do a route print I see the following entries:

Code: Select all

Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0        128.0.0.0         10.8.0.9        10.8.0.10    281
         10.8.0.0    255.255.255.0         10.8.0.9        10.8.0.10    281
         10.8.0.0  255.255.255.255     192.168.1.10     192.168.1.90     41
         10.8.0.1  255.255.255.255         10.8.0.9        10.8.0.10    281
         10.8.0.8  255.255.255.252         On-link         10.8.0.10    281
        10.8.0.10  255.255.255.255         On-link         10.8.0.10    281
        10.8.0.11  255.255.255.255         On-link         10.8.0.10    281
     192.168.1.10  255.255.255.255      192.168.1.1     192.168.1.90    296
     192.168.1.90  255.255.255.255         On-link      192.168.1.90    296
    192.168.1.255  255.255.255.255         On-link      192.168.1.90    296
My client.ovpn:

Code: Select all

dev tun
tls-client
remote 192.168.1.10 1194
redirect-gateway def1
dhcp-option DNS 192.168.1.10
pull

User avatar
TinCanTech
Forum Team
Posts: 9730
Joined: Fri Jun 03, 2016 1:17 pm

Re: OpenVPN server IP access

Post by TinCanTech » Mon Sep 27, 2021 7:41 pm

snikkelonius wrote:
Mon Sep 27, 2021 5:49 pm
How can I configure the client or server so that the original server IP is still routed to the VPN/DNS server?
You have to change to a different network, like a library, and connect the VPN to the public IP of your server.

Post Reply