Community discussions

MikroTik App
用户头像
nickb
Member
Member
Topic Author
Posts: 406
加入: Thu Jan 26, 2006 6:24 pm
Location:Southeast Kansas
Contact:

HOWTO: Windows File & Print Sharing over PPTP VPN

Wed Aug 05, 2009 12:40 am

I had an interesting problem today, of which I sawthisforum post but no solution.

I've managed to make this work as I desired, so I felt that it would be nice to share!

Scenario:

There's a LAN with multiple computers in WORKGROUP configuration.
This LAN uses a Mikrotik router for the Gateway (NAT).
The Gateway Mikrotik provides PPTP termination for work-from-home staff.
The work-from-home staff want to browse network shares & printers by name i.e. \\computername\sharename\

To resolve this situation it's important to understand that "windows file sharing" name resolution in a workgroup setting works by UDP broadcasts, and these broadcasts can't transit over the PPTP connection.

The solution is a WINS server. However, Mikrotik doesn't nativly provide a WINS server and in this context you probably don't want to install a "Windows Server" for its' WINS function (non-server versions of windows don't have a WINS server).

To resolve this, I:
  • Installed a version of Mikrotik withMetaROUTERsupport (v3.21 minimum)
  • Uploaded theOpenWRTimage provided by雷竞技网站
  • Followed the Wiki instructions for setting up theMetaROUTER
  • Created a bridge group, adding ether1 to the group
  • Added one interface to the MetaROUTER as a 'dynamic' interface, setting its' bridge to 'bridge1'
  • Set 'bridge1' and 'ether1' to PROXY-ARP (will not work without it!)
  • Connect to the MetaROUTER console and install the samba packages by doing:
    Code:Select all
    root@OpenWRT:/# opkg install http://downloads.openwrt.org/kamikaze/8.09.1/ifxmips/packages/samba-common_2.0.10-4.1_mips.ipk http://downloads.openwrt.org/kamikaze/8.09.1/ifxmips/packages/samba-server_2.0.10-4.1_mips.ipk
  • Update the ethernet configuration by editing /etc/config/network (on the OpenWRT) to read:
    Code:Select all
    # Copyright (C) 2006 OpenWrt.org config interface loopback option ifname lo option proto static option ipaddr 127.0.0.1 option netmask 255.0.0.0 config interface lan option ifname eth0 option proto static option ipaddr 192.168.0.2 option netmask 255.255.255.0 option gateway 192.168.0.1
    Note the removal of the "bridge" option. Set the IP addressing to whatever you want it to be.
  • Edit the Samba configuration and add:
    Code:Select all
    wins support = yes
    I also removed the /tmp share.
  • Start samba
    Code:Select all
    root@OpenWRT: / # /etc/init.d / samba开始
  • Change my PPTP and DHCP profiles to supply the WINS server
    Code:Select all
    /ip dhcp-server network set 0 wins-server=192.168.0.2 /ppp profile set 1 wins-server=192.168.0.2
Where the numbers are set appropriately i.e. the correct dhcp server and correct PPTP profile.

This should be everything!

I would like to say Thanks to the Mikrotik staff for providing an OpenWRT patch and download image!
Top
用户头像
nickb
Member
Member
Topic Author
Posts: 406
加入: Thu Jan 26, 2006 6:24 pm
Location:Southeast Kansas
Contact:

Re: HOWTO: Windows File & Print Sharing over PPTP VPN

Wed Aug 05, 2009 1:09 am

I just heard back from my customer. This configuration is allowing navigation but not browsing.

i.e. from a VPN client you can type in \\machinename but cannot browse it through "My Network Places".
Top
用户头像
Chupaka
Forum Guru
Forum Guru
Posts: 8689
加入: Mon Jun 19, 2006 11:15 pm
Location:Minsk, Belarus
Contact:

Re: HOWTO: Windows File & Print Sharing over PPTP VPN

Wed Aug 05, 2009 4:40 pm

for browsing, broadcast packets are being used. no broadcasting = no browsing
Top
用户头像
gmsmstr
Trainer
Trainer
Posts: 975
加入: Fri Jun 04, 2004 2:22 am
Location:St. Louis, MO
Contact:

Re: HOWTO: Windows File & Print Sharing over PPTP VPN

Wed Aug 05, 2009 4:48 pm

简单地说,文件haring and print sharing over a PPTP VPN is perfectly fine. THe fact that the admin don't know how to make it work shows this. RouterOS transports the IP network over, no prob. The rest is windows software and systems to make it work right. I have businesses that have 20 sites with no windows servers at them, and guess what they can browse, its not a function on broadcast. It is simply a function of the network and domain with the windows systems! If it is setup right, it will work with no prob.

I would suggest that you hire a Microsoft consultant to get the job done once you create the tunnel, cause that is all RouterOS is concerned with.
Top
用户头像
nickb
Member
Member
Topic Author
Posts: 406
加入: Thu Jan 26, 2006 6:24 pm
Location:Southeast Kansas
Contact:

Re: HOWTO: Windows File & Print Sharing over PPTP VPN

Wed Aug 05, 2009 7:20 pm

简单地说,文件haring and print sharing over a PPTP VPN is perfectly fine. THe fact that the admin don't know how to make it work shows this. RouterOS transports the IP network over, no prob. The rest is windows software and systems to make it work right. I have businesses that have 20 sites with no windows servers at them, and guess what they can browse, its not a function on broadcast. It is simply a function of the network anddomainwith the windows systems! If it is setup right, it will work with no prob.

I would suggest that you hire a Microsoft consultant to get the job done once you create the tunnel, cause that is all RouterOS is concerned with.
Emphesis added. It works perfectly fine if you have aDOMAIN.

My howto covers aWORKGROUP. These areverydifferent animals!

Your post comes across very condescending and rude. I never implied that ROS was not doing something properly - it's doing exactly what it's supposed to do. I'm merely sharing information that could help someone in the future.

I guess it's true what they say - no good deed goes unpunished.
Top
用户头像
gmsmstr
Trainer
Trainer
Posts: 975
加入: Fri Jun 04, 2004 2:22 am
Location:St. Louis, MO
Contact:

Re: HOWTO: Windows File & Print Sharing over PPTP VPN

Wed Aug 05, 2009 7:57 pm

First, I do apologize if I came across the wrong way. That was not my intent, So I do apologize if i did.

However, with or without a domain, you can make that work just fine.:)A domain is not a requirement.
Top
用户头像
nickb
Member
Member
Topic Author
Posts: 406
加入: Thu Jan 26, 2006 6:24 pm
Location:Southeast Kansas
Contact:

Re: HOWTO: Windows File & Print Sharing over PPTP VPN

Wed Aug 05, 2009 8:01 pm

Then how would you suggest making it work? I did several hours of research trying to figure out a way other than installing a WINS server on to the network, and was unable to locate any information that indicated there was any other way to do it.
Top
用户头像
gmsmstr
Trainer
Trainer
Posts: 975
加入: Fri Jun 04, 2004 2:22 am
Location:St. Louis, MO
Contact:

Re: HOWTO: Windows File & Print Sharing over PPTP VPN

Wed Aug 05, 2009 8:10 pm

You can do it with WINS or DNS. DNS would be better.
Top
用户头像
nickb
Member
Member
Topic Author
Posts: 406
加入: Thu Jan 26, 2006 6:24 pm
Location:Southeast Kansas
Contact:

Re: HOWTO: Windows File & Print Sharing over PPTP VPN

Wed Aug 05, 2009 8:23 pm

I'm really not a windows person, sorry:)

How would you do this with DNS, assuming that there isn't (and won't) be a Windows server?
Top
用户头像
hilton
Long time Member
Long time Member
Posts: 634
加入: Thu Sep 07, 2006 5:12 pm
Location:Jozi (aka Johannesburg), South Africa

Re: HOWTO: Windows File & Print Sharing over PPTP VPN

Thu Aug 06, 2009 1:44 pm

I'm really not a windows person, sorry :)

How would you do this with DNS, assuming that there isn't (and won't) be a Windows server?
Basically your problem boils down to not having a master browser service list that your PC can access. The VPN connection won't broadcast netbios packets (port 137). You need to either have a DNS server, or a WINS server, or play with LMHOSTS (in this order).
Top
用户头像
nickb
Member
Member
Topic Author
Posts: 406
加入: Thu Jan 26, 2006 6:24 pm
Location:Southeast Kansas
Contact:

Re: HOWTO: Windows File & Print Sharing over PPTP VPN

Thu Aug 06, 2009 8:13 pm

Basically your problem boils down to not having a master browser service list that your PC can access. The VPN connection won't broadcast netbios packets (port 137). You need to either have a DNS server, or a WINS server, or play with LMHOSTS (in this order).
The Mikrotik gateway is running DNS but as far as I know it doesn't allow registration from the windows clients.
Top
用户头像
hilton
Long time Member
Long time Member
Posts: 634
加入: Thu Sep 07, 2006 5:12 pm
Location:Jozi (aka Johannesburg), South Africa

Re: HOWTO: Windows File & Print Sharing over PPTP VPN

Thu Aug 06, 2009 9:42 pm

The Mikrotik gateway is running DNS but as far as I know it doesn't allow registration from the windows clients.
Yes it's only a 'resolving' name service. You'll need to run a full blown DNS server to get this to work for you. Or mess with lmhosts.sam or perhaps hosts file.

Just drop in a SME server, won't cost you much in hardware and you get the master browser plus an internal mail server plus a whole bunch of other stuff.
Top
rpress
Member Candidate
Member Candidate
Posts: 113
加入: Thu May 07, 2009 5:13 am

Re: HOWTO: Windows File & Print Sharing over PPTP VPN

Fri Aug 07, 2009 11:41 pm

There is a MikroTik script somewhere that will take the hostname from the DHCP leases and then create a DNS entry, kind of a "poor man's" DNS registration.
Top
psion
刚刚加入了
Posts: 10
加入: Thu Nov 12, 2009 8:02 am

Re: HOWTO: Windows File & Print Sharing over PPTP VPN

Thu Nov 12, 2009 11:56 am

good day, did you manage to get the browsing to work on this? Or allowed broadcast to be transferred over the pptp
Top
wmp1988
刚刚加入了
Posts: 5
加入: Fri Jul 20, 2012 10:13 am

Re: HOWTO: Windows File & Print Sharing over PPTP VPN

Fri Jul 20, 2012 10:23 am

Hi All,

If any one could be so kind as to share a link to the updated version of this, as i have tried to do the install of the openwrt but im getting problems installing samba common etc, seems to be kernal version miss match.

any ways im just trying to make a WINS server on my x86 Mikrotik and andy help would be greatly appreciated.

Regards
Wesley
Top
tombee79
Member Candidate
Member Candidate
Posts: 246
加入: Sun May 09, 2010 2:28 am

Re: HOWTO: Windows File & Print Sharing over PPTP VPN

Mon May 06, 2013 8:48 am

Hi

I am trying to do same thing. Can you guys tell me if you managed to create cross-subnet browsing with VPN and mikrotik SMB?

Let me know.

Here are some really use full links about samba wins browse list, subnet etc. all you need to make it happen.
http://www.linuxplanet.com/linuxplanet/tutorials/6600/1
http://www.onlamp.com/pub/a/onlamp/exce ... tml?page=3

My advise is:

Create 2 subnet one for the vpn user/s and the other for the main office.
enable SMB on the MT router, so you will have static IP that is allways on if it is possible to to force it local master browser. but if not since it is just one VPN user set him/her up with statick IP subnet and write that down.
for each user

than

sync all the vpn statick ip 1 ip address subnet ex. 192.168.1.1/24 local master browser with Domain master browser. ex: 192.168.2.10 ( can we change option of SMB in mikrotik lik smb os level etc to force the MT box to win the browser list election ) u can you x.x.x.255/MSWORKGOUP to broadcast to whole subnet but router will not alow to pass thru.
so use unicast thats static Domain Master browser ip instead.

Thats all.

Let me know if it worked. You may have few laptops with samba installed on it so you can tweak the SMB conf in there to do what you want to do. U dont need windows in this LAN configuration at all.
Top
a76
刚刚加入了
Posts: 8
加入: Tue May 22, 2012 6:42 am

Re: HOWTO: Windows File & Print Sharing over PPTP VPN

Fri Jun 14, 2013 8:00 pm

Hi there,

Just in case someone else comes across this... I was able to get name resolution across my VPN by adding my remote domain's DNS suffix to my NIC.

http://www.youtube.com/watch?v=CtgDLOjvJB8
Top

Who is online

Users browsing this forum:Bing [Bot],joshhboss,TrekkerTyreand 33 guests