2

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

Server Static IP: 10.0.0.66
Remote OpenVPN IP: 10.8.0.1

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

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

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

[Share]
    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 10.8.0.1 although it doesn't seem to have worked, Is there something I am missing?

UPDATE

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

\\10.8.0.1\Share

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 10.8.0.1? 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 10.8.0.1 and that ssh connection still works – TheLovelySausage Jun 1 '15 at 8:30
  • The client network is on the IP range 192.168.20.0/100 the client making the successful ssh connection is using the IP 192.168.20.13 – TheLovelySausage Jun 1 '15 at 8:31
0

This [most probably] is a routing issue.

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

  • either route 192.168.20.0/100 traffic through the OpenVPN interface on the server — it does require a change in smb.conf to allow access from 192.168.20.0/100 though;
  • or you can just NAT (actually masquerade) traffic coming from the 192.168.20.0/100 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.