Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Share folders over VPN
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help!
View previous topic :: View next topic  
Author Message
pk_fox
LXF regular


Joined: Wed Apr 13, 2005 2:38 pm
Posts: 292
Location: Surrey, UK

PostPosted: Fri May 09, 2014 11:04 am    Post subject: Share folders over VPN Reply with quote

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.
Back to top
View user's profile Send private message
ferrari
LXF regular


Joined: Tue May 03, 2005 12:09 pm
Posts: 127

PostPosted: Sat May 10, 2014 3:49 am    Post subject: Reply with quote

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:
hosts allow= 192.168.1. 10.0.8.


https://www.samba.org/samba/docs/using_samba/ch06.html
Back to top
View user's profile Send private message
pk_fox
LXF regular


Joined: Wed Apr 13, 2005 2:38 pm
Posts: 292
Location: Surrey, UK

PostPosted: Sat May 10, 2014 9:14 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
pk_fox
LXF regular


Joined: Wed Apr 13, 2005 2:38 pm
Posts: 292
Location: Surrey, UK

PostPosted: Sat May 10, 2014 11:17 am    Post subject: Reply with quote

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:
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 Sad 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.
Back to top
View user's profile Send private message
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8457
Location: Warrington, UK

PostPosted: Sat May 10, 2014 10:23 pm    Post subject: Reply with quote

Anything useful in the samba server log files?
_________________
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
Back to top
View user's profile Send private message
ferrari
LXF regular


Joined: Tue May 03, 2005 12:09 pm
Posts: 127

PostPosted: Sat May 10, 2014 11:00 pm    Post subject: Reply with quote

Did you restart smbd after the changes to smb.conf? As nelz suggested, check the samba logs (/var/log/samba/log.smbd).
Back to top
View user's profile Send private message
pk_fox
LXF regular


Joined: Wed Apr 13, 2005 2:38 pm
Posts: 292
Location: Surrey, UK

PostPosted: Sun May 11, 2014 8:42 am    Post subject: Reply with quote

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:

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:
failed to retrieve printer list: NT_STATUS_UNSUCCESSFUL

_________________
We can't stop here, this is bat country. Hunter S Thompson RIP.
Back to top
View user's profile Send private message
pk_fox
LXF regular


Joined: Wed Apr 13, 2005 2:38 pm
Posts: 292
Location: Surrey, UK

PostPosted: Sun May 11, 2014 8:46 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
ferrari
LXF regular


Joined: Tue May 03, 2005 12:09 pm
Posts: 127

PostPosted: Sun May 11, 2014 9:24 am    Post subject: Reply with quote

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/linux-networking-3/cannot-connect-to-samba-server-over-vpn-on-windows-network-361598/#post2884443
Back to top
View user's profile Send private message
pk_fox
LXF regular


Joined: Wed Apr 13, 2005 2:38 pm
Posts: 292
Location: Surrey, UK

PostPosted: Sun May 11, 2014 9:57 am    Post subject: Reply with quote

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/linux-networking-3/cannot-connect-to-samba-server-over-vpn-on-windows-network-361598/#post2884443


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.
Back to top
View user's profile Send private message
pk_fox
LXF regular


Joined: Wed Apr 13, 2005 2:38 pm
Posts: 292
Location: Surrey, UK

PostPosted: Sun May 11, 2014 10:22 am    Post subject: Reply with quote

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/linux-networking-3/cannot-connect-to-samba-server-over-vpn-on-windows-network-361598/#post2884443


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.
Back to top
View user's profile Send private message
pk_fox
LXF regular


Joined: Wed Apr 13, 2005 2:38 pm
Posts: 292
Location: Surrey, UK

PostPosted: Sun May 11, 2014 11:44 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
towy71
Moderator


Joined: Wed Apr 06, 2005 3:11 pm
Posts: 4259
Location: wild West Wales

PostPosted: Sun May 11, 2014 11:57 am    Post subject: Reply with quote

lose the windows box Wink Laughing Laughing
_________________
still looking for that door into summer
Back to top
View user's profile Send private message
pk_fox
LXF regular


Joined: Wed Apr 13, 2005 2:38 pm
Posts: 292
Location: Surrey, UK

PostPosted: Sun May 11, 2014 12:15 pm    Post subject: Reply with quote

towy71 wrote:
lose the windows box Wink Laughing Laughing


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.
Back to top
View user's profile Send private message
pk_fox
LXF regular


Joined: Wed Apr 13, 2005 2:38 pm
Posts: 292
Location: Surrey, UK

PostPosted: Sun May 11, 2014 12:27 pm    Post subject: Reply with quote

towy71 wrote:
lose the windows box Wink Laughing Laughing


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

Code:

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.
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help! All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast