What's new

REQUEST: Enable WAN access for Samba

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Chris Smith2

New Around Here
Thanks to all for the wonderful firmware.

My RT-AC68U works very well in Wireless router mode inside our Network. The 8TB Toshiba HDD attached to it works also flawlessly.

The WAN Connection is actually connecting to another internal Network. From this network the FTP access to the HDD works with the switch Enable WAN access for FTP activated in the GUI.

Can you please also add a similar switch "Enable WAN access for Samba"?

Thanks a lot!

Chris

Possible solution:
My current way to activate it is to edit /etc/smb.conf and for the simplicity I just delete all the lines with IP addresses in this file. Afterwards I kill and start the smb daemon again.
 
Is SMB secure enough for public access? (I think not.)

The probably better approach is to enable SMB locally then access it externally through a VPN.
 
No, as this would be a recipe for disaster, as plenty of users without the necessary technical knowledge would start enabling this on their WAN connection, and then complain as to how they are getting hacked, or why it doesn't work (as many ISPs will block those ports by default).

If you need such a specialized setup, I recommend you configure it manually through firewall-start and smb.postconf.
 
No, as this would be a recipe for disaster, as plenty of users without the necessary technical knowledge would start enabling this on their WAN connection, and then complain as to how they are getting hacked...

Your argument is okay. But why do you then apply it only to smb and not to ftp?
 
Your argument is okay. But why do you then apply it only to smb and not to ftp?

The FTP server is more "self-contained" than SMB, which can effectively open access to the rest of your LAN, as Samba talks to the rest of it.

Also, FTP is still somewhat widely used on the Internet. The protocol is less at risk to exploiting than the SMB protocol. Distributing files over a read-only anonymous account is fine, for instance.

Note that WAN access to FTP is part of the original firmware, it's not something I added. In fact, it's a unique feature of my firmware to have the option to disable it - stock firmware will automatically open it to the WAN when enabled.
 
file /jffs/scripts/smb.postconf
Code:
#!/bin/sh
CONFIG=$1
source /usr/sbin/helper.sh

pc_replace "interfaces = " "interfaces = eth0 " $CONFIG

How can I manually invoke this postconf script for testing?
 
Last edited:
service restart_samba

/jffs/scripts/smb.postconf /etc/smb.conf

works but

service restart_samba

ignores the file. o_O

EDIT:

Solution (LOL)

Enabling support for custom configs
Starting with 378.50, this functionality is disabled by default. To enable it, go to Administration -> System, then enable it under the JFFS section.
 
Last edited:
/jffs/scripts/smb.postconf /etc/smb.conf

works but

service restart_samba

ignores the file. o_O

Sorry!

Enabling support for custom configs
Starting with 378.50, this functionality is disabled by default. To enable it, go to Administration -> System, then enable it under the JFFS section.

Code:
service restart_nasapps
 
Also check to make sure it's in linux format....

dos2unix /jffs/scripts/smb.postconf
 
The samba installation is somehow broken (RT-AC68U, Firmware: 380.66_4).

log level = 2 shows

interpret_interface: Can't find address for lo
interpret_interface: Can't find address for br0
...

workaround in smb.conf:

interfaces = 127.0.0.1/255.0.0.0 ...
 
He is my (not optimal but working) configuration so far:

admin@RT-AC68U:/jffs/scripts# cat firewall-start
#!/bin/sh

iptables -A INPUT -p udp --dport 137 -j ACCEPT
iptables -A INPUT -p udp --dport 138 -j ACCEPT
iptables -A INPUT -p tcp --dport 139 -j ACCEPT
iptables -A INPUT -p tcp --dport 445 -j ACCEPT
iptables -D INPUT -j DROP
iptables -A INPUT -j DROP

admin@RT-AC68U:/jffs/scripts# cat smb.postconf
#!/bin/sh
CONFIG=$1
source /usr/sbin/helper.sh

pc_replace "interfaces = lo br0 192.168.1.50/255.255.255.0" "interfaces = 127.0.0.1/255.0.0.0 192.168.0.181/255.255.255.0 192.168.1.50/255.255.255.0" $CONFIG

Ofc, change the IP-Addresses accordingly and please read post #3 before doing this!
 

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top