USB NAS not accessible via openvpn or pptp

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Goto page 1, 2  Next
Author Message
zelto238
DD-WRT Novice


Joined: 19 Jun 2020
Posts: 3

PostPosted: Fri Jun 19, 2020 19:46    Post subject: USB NAS not accessible via openvpn or pptp Reply with quote
Hi All,

I have R7000 router which I recently upgraded the firmware to DD-WRT v3.0-r43392 std (06/12/20) from an earlier DD WRT build. After the upgrade, everything worked fine, but the USB drive that I connected to the router via NAS now can only be accessed from local lan, not by remote computers connected via openvpn or pptp. The Openvpn and pptp clients can connect to the router and they can access other LAN resources (e.g. if I share a windows folder from another local computer), but they just cannot access the USB drive attached to the router unless they are connected directly within the LAN. This used to work fine in the old build, and considering I'm practically using the same setting as the old firmware (including the firewall setting), I wonder what could be causing this to happen.

Your advice is greatly appreciated...
Sponsor
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 7178
Location: Texas, USA

PostPosted: Fri Jun 19, 2020 19:54    Post subject: Reply with quote
Please refer to the forum rules and guidelines. If a web search of this site or the forum search function has yielded no results to your question, then egc will likely chime in, but I am fairly certain that this topic has been discussed several times in detail in the forum recently, possibly under Advanced Networking.
_________________
Official Forum Rules, Guidelines, and Helpful InformationFirmware FAQInstallation WikiWhere Do I Download Firmware?
DON'T use Chromium-based browsersRTFM/STFW - TL;DR is NOT an excuse. • Why Should I Care What Color the Bikeshed Is?
Please DO NOT PM me with questions; Ask in the forum.

---------------------------------------------------------

Linux User #377467 counter.li.org / linuxcounter.net
zelto238
DD-WRT Novice


Joined: 19 Jun 2020
Posts: 3

PostPosted: Fri Jun 19, 2020 20:01    Post subject: USB NAS not accessible via openvpn or pptp Reply with quote
thanks, I tried some search before positing but didn't see much relevant answers initially...maybe I missed something...let me do a deeper search again
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 6154
Location: Netherlands

PostPosted: Fri Jun 19, 2020 20:54    Post subject: Reply with quote
Indeed like @kp69 mentioned it has been discussed.

We have a new in kernel samba which is still a WIP, it is possible to access the routers NAS but it needs "some" work.

For WireGuard and OpenVPN instructions are on page 17 of the WireGuard advanced setup guide and in the OpenVPN troubleshooting guide, links in my signature at the bottom of this post.

PPtP needs the same workaround as OpenVPN and Wireguard.
But as it is dynamic you need to restart samba after the interface is.
PPtP is unsafe and I would advise you to use OpenVPN or WireGuard.
There is a recent thread discussing this.

_________________
Routers:Netgear R7800, R6400v1, R6400v2, Linksys EA8500, EA6900 (XvortexCFE), E2000 (converted WRT320N), WRT54GS v1.
OpenVPN Policy Based Routing guide: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=321686
Install guide R6400v2:http://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
OpenVPN Server Setup:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=318795
Install guide R7800: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Wireguard Server setup guide:https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1183135
Wireguard Client setup guide:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324624
Wireguard Advanced setup guide:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324787
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
wabe
DD-WRT Guru


Joined: 17 Jun 2006
Posts: 761

PostPosted: Sat Jun 20, 2020 8:26    Post subject: Reply with quote
egc wrote:
Indeed like @kp69 mentioned it has been discussed.

We have a new in kernel samba which is still a WIP, it is possible to access the routers NAS but it needs "some" work.

For WireGuard and OpenVPN instructions are on page 17 of the WireGuard advanced setup guide and in the OpenVPN troubleshooting guide, links in my signature at the bottom of this post.

PPtP needs the same workaround as OpenVPN and Wireguard.
But as it is dynamic you need to restart samba after the interface is.
PPtP is unsafe and I would advise you to use OpenVPN or WireGuard.
There is a recent thread discussing this.


Even with ”some work” I’ve had no success in getting samba to work across a WireGuard tunnel. Still WIP I’m afraid

_________________
AC-68U rev. C1 on Build 44340
AC-68U rev. A1 on Build 44340
AC-68U rev. A1 on Build 44340
zelto238
DD-WRT Novice


Joined: 19 Jun 2020
Posts: 3

PostPosted: Sun Jun 21, 2020 4:59    Post subject: USB NAS not accessible via openvpn or pptp Reply with quote
tried to use bind interfaces only = no and set interfaces in /tmp/smb.conf, but once the router restarted, the file goes back to original file. so still not working for me.

Is there an older ddwrt build with working wireguard but have the version of samba that would work with vpn?
wabe
DD-WRT Guru


Joined: 17 Jun 2006
Posts: 761

PostPosted: Sun Jun 21, 2020 8:53    Post subject: Re: USB NAS not accessible via openvpn or pptp Reply with quote
zelto238 wrote:
tried to use bind interfaces only = no and set interfaces in /tmp/smb.conf, but once the router restarted, the file goes back to original file. so still not working for me.

Is there an older ddwrt build with working wireguard but have the version of samba that would work with vpn?


You cannot customize samba by editing /tmp/smb.conf, the changes does not stick. You may use your own configuration by placing it in the folder /jffs/etc.
You also need to copy the file smb.db to this location.
Follow the directions that egc has written up in his 'advanced setup guide on Wireguard'.

I cannot tell if there is indeed a version containing Wireguard and an older version of Samba.

I suppose you could install samba from the Entware respository and run that instead. Have not tried that though.

_________________
AC-68U rev. C1 on Build 44340
AC-68U rev. A1 on Build 44340
AC-68U rev. A1 on Build 44340
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 6154
Location: Netherlands

PostPosted: Sun Jun 21, 2020 9:41    Post subject: Reply with quote
It is like @wabe said, i got it working on build 43420 with the following but ksmbd is a WIP so YMMV (from WireGuard Advanced setup page 17):
Quote:
When you want to access the routers NAS via internet with an app like AndSMB or from a connected Windows client you have to make manual changes to the smb.conf file.

You need permanent storage (jffs), after you have setup USB and NAS, copy /tmp/smb.conf and /tmp/smb.db to /jfss/etc/ , those files will then be used by ksmbd for configuration after the router reboots (or after you restart ksmbd, see below).

In the Global section of smb.conf add all the interface you want ksmbd to listen to.
When no interfaces are specified it seems to default to br0, eth0, vlan2, I am using a WG tunnel oet1 and an OpenVPN server tunnel tun2 and also wanted access from the LAN (br0), so I add:
interfaces = br0, oet1, tun2 (if necessary add WAN interface vlan2, eth0 and other interfaces like br1 etc.)
Some setups also need to set the hosts allow but normally this is not necessary:
hosts allow = 192.168.1.0/24, 10.4.0.0/24, 10.8.0.0/24. (some say to also include the local host 127.0.0.1)


Have a look in the Wireguard advanced setup guide.

If you do not have permanent storage add the folowing in startup (I have not tested it, it is on my list to make a nice script from this but this is the core):
Code:
sed -i "s/\[global\]/\[global\]\ninterfaces = br0, oet1, vlan2, eth0/" /tmp/smb.conf


As I said I have not tested it and it only adds the first tunnel so maybe it works maybe not Sad

_________________
Routers:Netgear R7800, R6400v1, R6400v2, Linksys EA8500, EA6900 (XvortexCFE), E2000 (converted WRT320N), WRT54GS v1.
OpenVPN Policy Based Routing guide: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=321686
Install guide R6400v2:http://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
OpenVPN Server Setup:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=318795
Install guide R7800: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Wireguard Server setup guide:https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1183135
Wireguard Client setup guide:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324624
Wireguard Advanced setup guide:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324787
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
wabe
DD-WRT Guru


Joined: 17 Jun 2006
Posts: 761

PostPosted: Mon Jun 22, 2020 12:22    Post subject: Reply with quote
Just tested again out of curiosity. Did not work on 43420 but I managed to connect to a router running 43471. Used identical smb.conf files including the statement ‘interfaces = br0, oet1’. Build 43420 does not seem to bind the eot1 interface while 43471 does. Checked using ‘ps’’.
_________________
AC-68U rev. C1 on Build 44340
AC-68U rev. A1 on Build 44340
AC-68U rev. A1 on Build 44340


Last edited by wabe on Mon Jun 22, 2020 18:57; edited 1 time in total
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 6154
Location: Netherlands

PostPosted: Mon Jun 22, 2020 12:26    Post subject: Reply with quote
@wabe it could be that the smb.conf file is not read from jffs if jffs is "slow" to mount.

you should see it with PS that /tmp/smb.conf is used

If that is the case add in startup something like:
Code:
sleep 30
stopservice samba3
startservice samba3

_________________
Routers:Netgear R7800, R6400v1, R6400v2, Linksys EA8500, EA6900 (XvortexCFE), E2000 (converted WRT320N), WRT54GS v1.
OpenVPN Policy Based Routing guide: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=321686
Install guide R6400v2:http://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
OpenVPN Server Setup:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=318795
Install guide R7800: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Wireguard Server setup guide:https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1183135
Wireguard Client setup guide:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324624
Wireguard Advanced setup guide:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324787
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
wabe
DD-WRT Guru


Joined: 17 Jun 2006
Posts: 761

PostPosted: Mon Jun 22, 2020 14:30    Post subject: Reply with quote
It was loaded from jffs so that was not the problem. Did stop/start twice and checked with ‘ps’.
_________________
AC-68U rev. C1 on Build 44340
AC-68U rev. A1 on Build 44340
AC-68U rev. A1 on Build 44340
Zyxx
DD-WRT User


Joined: 28 Dec 2018
Posts: 259

PostPosted: Mon Jun 22, 2020 16:45    Post subject: Reply with quote
@wabe:
Isn't it oet1 instead of eot1?
wabe
DD-WRT Guru


Joined: 17 Jun 2006
Posts: 761

PostPosted: Mon Jun 22, 2020 18:56    Post subject: Reply with quote
Zyxx wrote:
@wabe:
Isn't it oet1 instead of eot1?

Just a misspelling here on the forum I'm afraid. But you made me check Smile

_________________
AC-68U rev. C1 on Build 44340
AC-68U rev. A1 on Build 44340
AC-68U rev. A1 on Build 44340
Zyxx
DD-WRT User


Joined: 28 Dec 2018
Posts: 259

PostPosted: Mon Jun 22, 2020 20:04    Post subject: Reply with quote
Cool It was worth a try!
madi123
DD-WRT User


Joined: 04 Mar 2008
Posts: 119

PostPosted: Sat Jul 04, 2020 12:06    Post subject: Reply with quote
I've got in touch with CIFSD developer, and hope this will eventually work for pptp as well, currently pptp-samba does not work without restarting the samba, since pptp uses temporary interfaces

https://github.com/cifsd-team/cifsd/issues/414

_________________
Routers: Netgears R7800, R7500v2, R7000, Linksys E4200v1 & WRT54GL
Note: I speak Russian/English
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
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
You can attach files in this forum
You can download files in this forum