I've recently setup OpenVPN for remote connection to our CentOS 6 file server.

Server Static IP:
Remote OpenVPN IP:

However when using the OpenVPN connection I am unable to access the Samba share which would normally be accessed using from inside the local network.

I have made the following adjustments to the smb.conf file according to the OpenVPN Website

    unix charset = UTF-8
    dos charset = CP932
    workgroup = WORKGROUP
    server string = Samba Server Version %v
    # include for OpenVPN
    hosts allow = 
    interfaces =
    log file = /var/log/samba/log.%m
    max log size = 50
    security = share
    passdb backend = tdbsam

    path = /samba/share01
    writable = yes
    browsable = yes
    guest ok = yes
    guest only = yes
    create mode = 0777
    directory mode = 0777

Then I try to access the Samba share using although it doesn't seem to have worked, Is there something I am missing?


The issue has been resolved

I made some slight changes to the smb.conf file, the one above is the latest. The other issue was how the share was being accessed.

When mapping the network location I had to specify the share I wanted to connect to


Then it brought it up just fine.

Thanks to everyone for their help

closed as off-topic by sebasth, G-Man, Jeff Schaller, slm Aug 14 '18 at 1:50

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – sebasth, G-Man, Jeff Schaller, slm
If this question can be reworded to fit the rules in the help center, please edit the question.

  • What are the routes and local IP address on the [remote] client side? – user86969 Jun 1 '15 at 8:21
  • Are you sure Server IP is Looks like that address might be the GW address and to access the samba share you should not change any IP in you smb.conf, just make sure routes are OK after establishing the VPN connection. – YoMismo Jun 1 '15 at 8:21
  • Before the Samba share was required the server had always been accessed through ssh to and that ssh connection still works – TheLovelySausage Jun 1 '15 at 8:30
  • The client network is on the IP range the client making the successful ssh connection is using the IP – TheLovelySausage Jun 1 '15 at 8:31

This [most probably] is a routing issue.

Your Samba server, as far as the remote part is concerned, is accessed from so here are two possibilities:

  • either route traffic through the OpenVPN interface on the server — it does require a change in smb.conf to allow access from though;
  • or you can just NAT (actually masquerade) traffic coming from the network on your OpenVPN server interface using iptables.

The latter option should require no change in smb.conf.

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