I have configured open VPN in my home and that can be accessible from my office easily. Now I want to share samba via my open VPN. How do I can share samba over open VPN between Ubuntu and Windows?. Please help me, anybody. Home public IP: HHH.OOO.MMM.EEE Home desktop IP: 192.168.10.10 Office public IP: OOO:FFF:III:CCC Office Windows desktop IP: 192.168.1.10

share|improve this question
up vote 3 down vote accepted

In short: Make sure that samba accepts connections from the VPN subnet.

In more detail (from the OpenVPN wiki):

Next, edit your Samba configuration file (smb.conf). Make sure the hosts allow directive will permit OpenVPN clients coming from the 10.8.0.0/24 subnet to connect. For example:

hosts allow = 10.66.0.0/24 10.8.0.0/24 127.0.0.1

If you are running the Samba and OpenVPN servers on the same machine, you may want to edit the interfaces directive in the smb.conf file to also listen on the TUN interface subnet of 10.8.0.0/24:

interfaces  = 10.66.0.0/24 10.8.0.0/24

If you are running the Samba and OpenVPN servers on the same machine, connect from an OpenVPN client to a Samba share using the folder name:

\\10.8.0.1\\sharename

(10.66.0.0 is the home subnet in their example, 10.8.0.0 is the VPN subnet)

Afterwards, restart the samba service to take the new configuration into account:

sudo service smbd restart
share|improve this answer
1  
While its less security minded, since the entire 10.*.*.* network is private, I just use "hosts allow = 10.", this allows all hosts from any 10.*.*.* network. – FreeSoftwareServers Apr 16 '16 at 21:45

This applies if your remote VPN is running on a different computer than the SMB share.

I think that what you want is the following to your OpenVPN config file.

push "route 192.168.1.0 255.255.255.0"

This allows your remote computer to see the rest of the Remote 192.168.1.* network, if you don't have this line, then it will only be able to access remote resources on the computer running the VPN server.

Here is my guide which includes a few other configs I make related to IPTables and UFW.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.