How to access windows-share on work LAN via OpenVPN?

This forum is for admins who are looking to build or expand their OpenVPN setup.

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

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
tech77
OpenVpn Newbie
Posts: 2
Joined: Fri Aug 30, 2019 8:21 pm

How to access windows-share on work LAN via OpenVPN?

Post by tech77 » Fri Aug 30, 2019 8:43 pm

Hello community,

I want to connect to my Synology DS218 (windows-share) via openvpn from abroad. I need this to use a Document-Management-Software. This DMS-Software has a database which is stored on a Windows share called \\work-server

But I use a OpenVPN-Server on a Synology DS112+ (OpenVPN-Server)

My Hardware:
Please look at the sketch in the link.
Image

------ additional Infos: ------

Notebook:
Win 10 Pro,
IP 192.168.51.43
(in Work-network)
This is the Notebook that I want to use abroad.

My Test Setup to simulate a connection from a “Hotel” is an Android Smartphone.
I use 4G Vodafone Network with WiFi-tethering to connect to my work-network.

On the Win 10 Pro Notebook: I’m able to connect the OpenVPN GUI Software and the icon is green.

When I access a website to check my ISP + Public IP it shows the ISP Provider Telefonica o2. So far, so good.

My Notebook/Windows WiFi-Adapter gets an DHCP-IP from the Android Smartphone
DHCP: on
IP: 192.168.43.44
Subnet: 255.255.255.0
Gateway: 192.168.43.1
DNS: 192.168.43.1

The virtual TAP-Windows Adapter V9 shows:
IP: 10.12.0.6
Subnet: 255.255.255.252
(OpenVPN-)DHCP-Server: 10.12.0.5

-----------------------------------------------

My question: How can I access the Synology DS218 (windows-share) via the Synology DS112+ (OpenVPN-Server)

How do connect the 192.168.51.xx-IP-Range on my remote Client Notebook. I’m not able to connect the Windows-share via \\work-server in Windows-Explorer.

What steps are needed to let it work?

Thank you for your help and time.

Regards,
Tom

300000
OpenVPN Expert
Posts: 685
Joined: Tue May 01, 2012 9:30 pm

Re: How to access windows-share on work LAN via OpenVPN?

Post by 300000 » Mon Sep 02, 2019 9:11 am

you need to run your own DNS server and WINs server at your Synology DS112+ so client have info to connect to windows share ,


if your Synology running samba and dnsmasq just edit config file samba as

netbios name = DD-WRT
workgroup = WORKGROUP
server string = DD-WRT
syslog = 10
name resolve order = wins lmhosts host bcast
obey pam restrictions = yes
socket options = TCP_NODELAY
preferred master = no
os level = 20
wins support = yes
security = share
guest account = nobody
invalid users = root, mail, deamon, reboot
null passwords = yes

this line wins support = yes make samba running as WINs service and it needed when you want connec to share file over vpn

and go to find dnsmasq config and edit as

listen-address =127.0.0.1
listen-address=192.168.50.1
listen-address=989.906.716.919
local=/mydomain.com/
mx-host=mydomain.com,mail.mydomain.com,10
txt-record=mydomain.com,"v=spf1 a -all"


address=/windowsshare.mydomain.com/192.168.51.11

domain-needed
bogus-priv



so if you can run both samba and dnsmasq at you Synology DS112 and from windown openvpn client you can connect to network share using name type into address bar \\windowsshare.mydomain.com and it will connect to your share forder, you must type it into address bar to connec it because file sharing is non routing protocol

User avatar
Pippin
Forum Team
Posts: 1201
Joined: Wed Jul 01, 2015 8:03 am
Location: irc://irc.libera.chat:6697/openvpn

Re: How to access windows-share on work LAN via OpenVPN?

Post by Pippin » Mon Sep 02, 2019 5:07 pm

All you have to do is tick "Allow clients to access LAN" in OpenVPN Server package
and create a firewall rule (in DSM) for the VPN subnet, 10.12.0.0 255.255.255.0
If still cannot access the Windows machine using it's IP address then your problem is Windows...

User avatar
Pippin
Forum Team
Posts: 1201
Joined: Wed Jul 01, 2015 8:03 am
Location: irc://irc.libera.chat:6697/openvpn

Re: How to access windows-share on work LAN via OpenVPN?

Post by Pippin » Mon Sep 02, 2019 5:17 pm

Hehe,

I should read more carefully...
You can setup the DNS Server package on the DS.

tech77
OpenVpn Newbie
Posts: 2
Joined: Fri Aug 30, 2019 8:21 pm

Re: How to access windows-share on work LAN via OpenVPN?

Post by tech77 » Fri Sep 06, 2019 9:33 pm

Hi,

big thanks for your advice. Setting up the DNS Server exceeds my technical skills. The VPN Server Setup is in my skill-range. I have to use the //192.168.51.11 connection-solution.

But thank you for your time and help

regards,
Tom

Post Reply