Share folders over VPN

The place to post if you need help or advice

Moderators: ChrisThornett, LXF moderators

Share folders over VPN

Postby pk_fox » Fri May 09, 2014 10:04 am

Hi All, I've setup a VPN using openvpn and can connect ok from my Linux and Windows boxes, my question is how can I share folders and files that are present on the VPN host ? for example when I connect to the VPN using the OpenVpn client I get an ip address of e.g. 10.0.8.10 so I assumed I could mount any exported shares on the host using the \\ipaddress\share method but It seems I can't, I've setup samba shares and can connect using the "real" ip address when I'm on the the LAN but not when using the VPN - hope this makes sense
We can't stop here, this is bat country. Hunter S Thompson RIP.
User avatar
pk_fox
LXF regular
 
Posts: 298
Joined: Wed Apr 13, 2005 1:38 pm
Location: Surrey, UK

Postby ferrari » Sat May 10, 2014 2:49 am

As it happens, I have to access remote Windows shares via a VPN from time to time, with no special configuration required (from a client perspective)

This sounds like a server related configuration issue. Is your samba server a *nix or Windows machine?

In Windows, it may be necessary to adjust the firewall (file and printer sharing) and edit to allow access by specifying the VPN network/subnet.

If you have a samba server running on a *nix box, then you'll need to edit smb.conf to allow access from other networks eg

Code: Select all
hosts allow= 192.168.1. 10.0.8.


https://www.samba.org/samba/docs/using_samba/ch06.html
ferrari
LXF regular
 
Posts: 142
Joined: Tue May 03, 2005 11:09 am

Postby pk_fox » Sat May 10, 2014 8:14 am

Hi, its ( the VPN host ) a Debian box with Samba shares, I think I've already tried what you suggest but will check, thanks a lot
We can't stop here, this is bat country. Hunter S Thompson RIP.
User avatar
pk_fox
LXF regular
 
Posts: 298
Joined: Wed Apr 13, 2005 1:38 pm
Location: Surrey, UK

Postby pk_fox » Sat May 10, 2014 10:17 am

ferrari wrote:As it happens, I have to access remote Windows shares via a VPN from time to time, with no special configuration required (from a client perspective)

This sounds like a server related configuration issue. Is your samba server a *nix or Windows machine?

In Windows, it may be necessary to adjust the firewall (file and printer sharing) and edit to allow access by specifying the VPN network/subnet.

If you have a samba server running on a *nix box, then you'll need to edit smb.conf to allow access from other networks eg

Code: Select all
hosts allow= 192.168.1. 10.0.8.


https://www.samba.org/samba/docs/using_samba/ch06.html


Hi, I tried what you suggested but no luck :-( it's weird as I can ping the VPN's ip address so the connection is definitely ok
We can't stop here, this is bat country. Hunter S Thompson RIP.
User avatar
pk_fox
LXF regular
 
Posts: 298
Joined: Wed Apr 13, 2005 1:38 pm
Location: Surrey, UK

Postby nelz » Sat May 10, 2014 9:23 pm

Anything useful in the samba server log files?
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8523
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby ferrari » Sat May 10, 2014 10:00 pm

Did you restart smbd after the changes to smb.conf? As nelz suggested, check the samba logs (/var/log/samba/log.smbd).
ferrari
LXF regular
 
Posts: 142
Joined: Tue May 03, 2005 11:09 am

Postby pk_fox » Sun May 11, 2014 7:42 am

nelz wrote:Anything useful in the samba server log files?


There's a file called log.10.8.0.6 in /var/log/samba which contains
Code: Select all
stat of  /var/lib/usershares/data failed no such file or directory

Which is correct it doesn't exist, also in a file called log.smbd there are lots of lines containing

Code: Select all
failed to retrieve printer list: NT_STATUS_UNSUCCESSFUL
We can't stop here, this is bat country. Hunter S Thompson RIP.
User avatar
pk_fox
LXF regular
 
Posts: 298
Joined: Wed Apr 13, 2005 1:38 pm
Location: Surrey, UK

Postby pk_fox » Sun May 11, 2014 7:46 am

ferrari wrote:Did you restart smbd after the changes to smb.conf? As nelz suggested, check the samba logs (/var/log/samba/log.smbd).


Hi there, yes I did -
We can't stop here, this is bat country. Hunter S Thompson RIP.
User avatar
pk_fox
LXF regular
 
Posts: 298
Joined: Wed Apr 13, 2005 1:38 pm
Location: Surrey, UK

Postby ferrari » Sun May 11, 2014 8:24 am

You might want to post the [global] section of your smb.conf here. It's not obvious to me about what is failing here, especially if you can ping each end of the VPN successfully. (I assume you did that already.)

In any case, I wonder if this approach might work for you

http://www.linuxquestions.org/questions ... ost2884443
ferrari
LXF regular
 
Posts: 142
Joined: Tue May 03, 2005 11:09 am

Postby pk_fox » Sun May 11, 2014 8:57 am

ferrari wrote:You might want to post the [global] section of your smb.conf here. It's not obvious to me about what is failing here, especially if you can ping each end of the VPN successfully. (I assume you did that already.)

In any case, I wonder if this approach might work for you

http://www.linuxquestions.org/questions ... ost2884443


Yes I can ping both ends of the VPN and I can mount the shares using the proper IP address on the LAN but not using my VPN IP address, as you've probably gathered im testing this locally but it shouldn't make any difference should it ?
We can't stop here, this is bat country. Hunter S Thompson RIP.
User avatar
pk_fox
LXF regular
 
Posts: 298
Joined: Wed Apr 13, 2005 1:38 pm
Location: Surrey, UK

Postby pk_fox » Sun May 11, 2014 9:22 am

ferrari wrote:You might want to post the [global] section of your smb.conf here. It's not obvious to me about what is failing here, especially if you can ping each end of the VPN successfully. (I assume you did that already.)

In any case, I wonder if this approach might work for you

http://www.linuxquestions.org/questions ... ost2884443


Hi , I think I might have been a Muppet here, I thought that to mount my share I would use the IP address issued by the Openvpn client which in my case is something like 10.8.0.6, I now think this is wrong , for the hell of it I tried mounting using the VPN server IP address and it worked !!!! So as usual it was operator trouble. Is this the correct way of connecting ? And thanks for your time.
We can't stop here, this is bat country. Hunter S Thompson RIP.
User avatar
pk_fox
LXF regular
 
Posts: 298
Joined: Wed Apr 13, 2005 1:38 pm
Location: Surrey, UK

Postby pk_fox » Sun May 11, 2014 10:44 am

One more thing ! Testing this setup connecting from an Android tablet works perfectly, ditto my Fedora laptop, but if I run my windows OpenVpn client on my Windows 7 box I lose DNS on the client - any ideas ?
We can't stop here, this is bat country. Hunter S Thompson RIP.
User avatar
pk_fox
LXF regular
 
Posts: 298
Joined: Wed Apr 13, 2005 1:38 pm
Location: Surrey, UK

Postby towy71 » Sun May 11, 2014 10:57 am

lose the windows box :wink: :lol: :lol:
still looking for that door into summer
User avatar
towy71
Moderator
 
Posts: 4264
Joined: Wed Apr 06, 2005 2:11 pm
Location: wild West Wales

Postby pk_fox » Sun May 11, 2014 11:15 am

towy71 wrote:lose the windows box :wink: :lol: :lol:


Unfortunately it's my workplace box so not possible, I think I need to add a "push" command in the config file on the the server to add a gateway or something along these lines
We can't stop here, this is bat country. Hunter S Thompson RIP.
User avatar
pk_fox
LXF regular
 
Posts: 298
Joined: Wed Apr 13, 2005 1:38 pm
Location: Surrey, UK

Postby pk_fox » Sun May 11, 2014 11:27 am

towy71 wrote:lose the windows box :wink: :lol: :lol:


Got it sorted I added the following line to server.conf

Code: Select all
push "dhcp-option DNS 194.168.4.100"


which is the address of my dns on my router.
We can't stop here, this is bat country. Hunter S Thompson RIP.
User avatar
pk_fox
LXF regular
 
Posts: 298
Joined: Wed Apr 13, 2005 1:38 pm
Location: Surrey, UK

Next

Return to Help!

Who is online

Users browsing this forum: huwgreen and 0 guests