Page 1 of 2

[HOWTO] Install samba 3.6.25 on a ZyXEL fw4 nas

Posted: Sat 12. Jan 2019, 10:11
by Mijzelf
The samba version on ZyXEL fw4 boxes is old, and supports only the smb1 protocol. Windows 10 by default doesn't support smb1 anymore, so there's a problem.

Fortunately samba is more or less separated from the rest of the firmware, so it's possible to replace it. Entware-ng provides a samba server 3,6,25 for Armv5, which is new enough to support smb2.

I wrote a small package zyxel-samba-replacement, which injects Entware-ng samba into the firmware.

How it works
The firmware samba is started and stopped using the /etc/init.d/samba.sh script. Samba is configured to use /etc/samba/smb.conf as configuration file. When you change some samba settings in the webinterface, smb.conf is updated, and a signal is send to the running samba daemon to reload the configuration.

The zyxel-samba-replacement stops firmware samba by executing '/etc/init.d/samba.sh stop', and then exchanges the script by a symlink to /opt/etc/init.d/S09ZyXELSambaReplacement, and starts Entware-ng samba.
This samba uses /opt/etc/samba/ZyXELSambaReplacement.conf as configuration. This file enables smb2, and then includes /etc/samba/smb.conf. This way the firmware can change configuration without touching our smb2 setting.

How to install

Code: Select all

su
opkg update
opkg install zyxel-samba-replacement     # will automatically pull the samba server

# disable the Entware-ng samba server and script
/opt/etc/init.d/S08samba stop
chmod a-x /opt/etc/init.d/S08samba

# enable and start the replacement script
chmod a+x /opt/etc/init.d/S09ZyXELSambaReplacement
/opt/etc/init.d/S09ZyXELSambaReplacement start
That's it. It can be confusing that by executing '/opt/etc/init.d/S09ZyXELSambaReplacement start' you see samba stopping, and with '/opt/etc/init.d/S09ZyXELSambaReplacement stop' you see it starting. That's the firmware samba. The replacement script always stops one, and starts the other.

Known issues
The recycle bin doesn't work. So disable it on all shares before installing the replacement.

Re: [HOWTO] Install samba 3.6.25 on a ZyXEL fw4 nas

Posted: Fri 1. Feb 2019, 10:04
by Kostya_Ye
Hi Mijzelf,

Thank you a lot for your overall contribution to Zyxel NAS community in general and for this package particular.

I use NSA325v2 and recently was ought to upgrade my PC to Win10, accordingly I decided to upgrade samba on my NSA. I've installed zyxel-samba-replacement package successfully and the only minor issue I have is the NSA is not visible in network browser on Win10. Same way on smb1 devices like media player and smart TV NSA is not visible as well.
But by the entrance of IP address to either address string in Win10 explorer or link in media player and smart TV NSA is accessible and I'm able to map drive in Win10 and read files from NSA on player and TV.
Please comment if this is a normal behaviour.

Re: [HOWTO] Install samba 3.6.25 on a ZyXEL fw4 nas

Posted: Sun 3. Feb 2019, 14:44
by Mijzelf
Kostya_Ye wrote:Please comment if this is a normal behaviour.
Actually I don't know, but it wouldn't surprise me. I don't own any Windows PC's, and borrowed a W10 laptop to test the Samba implementation. It worked, and so did it on my Linux box. I never looked if the nas/share was visible in the network browser. Just haven't thought of it. On the nas-central forum people reported that the Recycle bin didn't work, another thing I didn't test. Maybe someone also mentioned that network browsing doesn't work, but I can't remember, and unfortunately the forum is down.

It wouldn't surprise me if that is normal behaviour because the way it was implemented in smb1 (or actually, in netbios), doesn't scale up very well, and is hard to route. Basically it's dependent on broadcasts, and if you have a lot of Windows machines, that can become a serious network load.
So it isn't surprising if MS dumped that for something more efficient. But the truth is that I don't know how it works now. Maybe the Entware samba package doesn't support it. Maybe it needs some extra configuration in /opt/etc/samba/ZyXELSambaReplacement.conf.

Re: [HOWTO] Install samba 3.6.25 on a ZyXEL fw4 nas

Posted: Tue 5. Feb 2019, 17:39
by Kostya_Ye
Hi Mijzelf,
OK, clear.
as i wrote such samba behavior is not a big problem for me so just will keep as it goes.

Re: [HOWTO] Install samba 3.6.25 on a ZyXEL fw4 nas

Posted: Sun 10. Mar 2019, 12:32
by kralle
Hello,
Mijzelf wrote: How to install
i read this three times but i don't understand who i can put the changes on my NSA310.
Must i use a linux-pc und a ssh connection to my NAS or can i replace the settings via webinterface ?
And where is the file "zyxel-samba-replacement" ?

I'm a german Win10-User and i need your help.
I will only update samba and not the complete Firmware.
I will not lose any files on my NAS.

Greetings from germany
Heiko

Re: [HOWTO] Install samba 3.6.25 on a ZyXEL fw4 nas

Posted: Sun 10. Mar 2019, 14:35
by Mijzelf
This thread is posted in the Entware-ng subforum, and the install instructions presume that you have installed and are using Entware-ng. So install that first (instructions here), and come back if zyxel-samba-replacement still puzzles your.

Re: [HOWTO] Install samba 3.6.25 on a ZyXEL fw4 nas

Posted: Sat 21. Sep 2019, 12:08
by mes
Hi!

I want to update SMB on my NSA325 V2 (FW4.81) to a higher version to get it work with WIN10 again and to get rid of security issues caused by SMB1.

So I was very happy about this thread, but unfortunatey I am not able to make it work! :-( I spent now days and it doesnt work, so I would really appreciate your help.

Steps done so far:

1) Activated MetaRepository (20181001zypkg015), so I was able to install Entware_ng in the package view of web ui
2) Installed Entware_ng in the package view of web ui (20181002zypkg006) - Note: SSH is installed, FFP is not installed
3) Started SSH with root login
4) Tried to execute the commands as stated in "How to install" section
5) opkg update - returns: command not found!
6) the same when I am entering the complete path to opkg or moving to the targer directory and entering opkg update

After I was stuck here, I also tried the sceanrio with creating an FAT USB Stick and booting the NSA with it (USB port1 on backside) - but this was also not successful, as the NSA boots, but the in SSH the commands still not working.

There must be something I am doing wrong - can anybody help? Please

Many thanks in advance.

Re: [HOWTO] Install samba 3.6.25 on a ZyXEL fw4 nas

Posted: Sat 21. Sep 2019, 17:18
by shv
Du kannst auch versuchen, SMB1.0 unter Windows 10 zu aktivieren.
https://mein-dms.agorum.com/blog/so-akt ... windows-10

Ich hatte auf einem älteren PC das Problem, dass es damit trotzdem nicht ging. Ich musste dann Windows 10 auf diesem PC neu installieren.

Re: [HOWTO] Install samba 3.6.25 on a ZyXEL fw4 nas

Posted: Sat 21. Sep 2019, 19:38
by mes
@shv: Danke für den Tipp! Das ist allerdings keine Alternative - ich hätte das Sicherheitsrisiko SMB1 gerne ausgeräumt.

@Mijzelf: Any idea?

Re: [HOWTO] Install samba 3.6.25 on a ZyXEL fw4 nas

Posted: Sun 22. Sep 2019, 14:27
by Mijzelf
mes wrote: @Mijzelf: Any idea?
Not directly. It should have worked. In the webinterface you should be able to find the log of the initial install. Can you post that?