What's new

wsdd2 from Entware collides with Asuswrt-Merlin 384.12

  • 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!

Samba 4 runs perfectly on my system deployed on both Asuswrt and Asuswrt Merlin. For security reasons, My samba addon only supports SMB2 and above. SMB1 has been disable, which means, I just use smbd (samba server), wsdd2 (for Windows discovery) and avahi (for MacOS and iOS discovery) to run samba service.

Anybody who understand shell script will understand my samba addon by reading the codes here (https://github.com/JACK-THINK/SCRIP...OUTER/tree/master/script_bootloader/usr/samba)

All the codes of my system are written in shell with both Chinese and English comments. It's very easy to read and modified.

You can execute only one line below to deploy my system on both Asuswrt and Asuswrt Merlin with a blank USB flash drive attached to your router.
Code:
cd /tmp && wget -O /tmp/install_online --no-check-certificate "https://raw.githubusercontent.com/JACK-THINK/SCRIPTS-BOOTLOADER-FOR-ASUS-ROUTER/master/script_bootloader/bin/install_online" && chmod 777 /tmp/install_online && /tmp/install_online

have you done any performance test with the smb 3 feature, or is it pretty much maxed once you hit the smb2 as far a performance? (file transfer test)
 
on RT-AC86U..
no problem to run wsdd2 of Entware.
Even when run with merlin-wsdd2.
Code:
@RT-AC86U-69B8:/tmp/home/root# lsof -i | grep 3702
@RT-AC86U-69B8:/tmp/home/root# /opt/bin/wsdd2 -W
cannot read workgroup from testparm
cannot read netbios name from testparm

Code:
@RT-AC86U-69B8:/tmp/home/root# lsof -i | grep 3702
wsdd2      7564 admin 30u  inet 1929463      0t0  UDP *:3702
wsdd2      7564 admin 31u  inet 1929464      0t0  TCP *:3702 (LISTEN)
@RT-AC86U-69B8:/tmp/home/root# /opt/bin/wsdd2 -W
cannot read workgroup from testparm
cannot read netbios name from testparm
 
on RT-AC86U..
no problem to run wsdd2 of Entware.
Even when run with merlin-wsdd2.
Code:
@RT-AC86U-69B8:/tmp/home/root# lsof -i | grep 3702
@RT-AC86U-69B8:/tmp/home/root# /opt/bin/wsdd2 -W
cannot read workgroup from testparm
cannot read netbios name from testparm

Code:
@RT-AC86U-69B8:/tmp/home/root# lsof -i | grep 3702
wsdd2      7564 admin 30u  inet 1929463      0t0  UDP *:3702
wsdd2      7564 admin 31u  inet 1929464      0t0  TCP *:3702 (LISTEN)
@RT-AC86U-69B8:/tmp/home/root# /opt/bin/wsdd2 -W
cannot read workgroup from testparm
cannot read netbios name from testparm

It seems that you are getting ERRORS.

My test is based on the RT-AC68U with Asuswrt-Merlin 384.12, which has been reset to factory after flashing Asuswrt-Merlin 384.12. And I get errors as shown in #1.
 
on RT-AC86U..
no problem to run wsdd2 of Entware.
Good to know. But also this post says he's having the same problem as the OP even with the current Merlin release. So that suggests to me that there is still some ongoing compatibility issue with wsdd2 generally and not some conspiracy to disable the Entware version.

Prior to today I wasn't even aware that there was an Entware version of wsdd2. So until more than one person reports this as a problem I'll take everything with a pinch of salt.
 
I haven't done a performance test. But I do refer to some posts on the forum to improve the smb.conf in my samba addon. You can give it a try.
I mean, in reality you are still only going to be limited to whatever the router can handle, before A it finishes, or B it implodes, so i really cannot imagine it getting any better than what SMB2 could offer, that already uses a lot of resources loading files and what not.
 
Good to know. But also this post says he's having the same problem as the OP even with the current Merlin release. So that suggests to me that there is still some ongoing compatibility issue with wsdd2 generally and not some conspiracy to disable the Entware version.

Prior to today I wasn't even aware that there was an Entware version of wsdd2. So until more than one person reports this as a problem I'll take everything with a pinch of salt.
Out of sheer curiosity, I installed it and do get the conflict messages. :eek: and this was after service stop_samba to kill the built-in stuff.
Code:
# /opt/bin/wsdd2 -W
cannot read workgroup from testparm
cannot read netbios name from testparm
wsdd-http-v4: open_ep: bind: Address already in use
wsdd-http-v4: open_ep: bind: Address already in use
llmnr-tcp-v4: open_ep: bind: Address already in use
llmnr-tcp-v4: open_ep: bind: Address already in use
^CInterrupt received.
 
Good to know. But also this post says he's having the same problem as the OP even with the current Merlin release. So that suggests to me that there is still some ongoing compatibility issue with wsdd2 generally and not some conspiracy to disable the Entware version.

Prior to today I wasn't even aware that there was an Entware version of wsdd2. So until more than one person reports this as a problem I'll take everything with a pinch of salt.

Perhaps these things below could help you.

1. nmbd is deprecated in smaba4 from Entware

2. In order to make wsdd2 from Entware run properly, You MUST run 'nvram get computer_name' and paste the value you get on the right of "netbios name = " in smb.conf. If you don't set it like this, you can still discover the share with the netbios name you set, but you can never connect to it successfully from Network Neighbour in Windows 10.

3. Put a # before "syslog" in smb.conf since syslog has been deprecated in samba4.

4. wsdd2 from Entware won't make MacOS or iOS able to discover your samba share. You can write a smb.service as below for avahi which is included in both Asuswrt-Merlin and Asuswrt, and put it in the directory /tmp/avahi/services.
Code:
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
  <name replace-wildcards="yes">Samba on %h</name>
  <service>
      <type>_smb._tcp</type>
      <port>445</port>
  </service>
</service-group>

Your can refer to more things/codes from here. (https://github.com/JACK-THINK/SCRIP...OUTER/tree/master/script_bootloader/usr/samba)
 
Perhaps these things below could help you.

1. nmbd is deprecated in smaba4 from Entware

2. In order to make wsdd2 from Entware run properly, You MUST run 'nvram get computer_name' and paste the value you get on the right of "netbios name = " in smb.conf. If you don't set it like this, you can still discover the share with the netbios name you set, but you can never connect to it successfully from Network Neighbour in Windows 10.

3. Put a # before "syslog" in smb.conf since syslog has been deprecated in samba4.

4. wsdd2 from Entware won't make MacOS or iOS able to discover your samba share. You can write a smb.service as below for avahi which is included in both Asuswrt-Merlin and Asuswrt, and put it in the directory /tmp/avahi/services.
Code:
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
  <name replace-wildcards="yes">Samba on %h</name>
  <service>
      <type>_smb._tcp</type>
      <port>445</port>
  </service>
</service-group>

Your can refer to more things/codes from here. (https://github.com/JACK-THINK/SCRIP...OUTER/tree/master/script_bootloader/usr/samba)

Eagerly waiting for the English translation when you get the time (for your linked page). :)
 
Out of sheer curiosity, I installed it and do get the conflict messages. :eek: and this was after service stop_samba to kill the built-in stuff.
Well I installed it on my router and received the same errors. And I'm using John's fork which is an entirely different code base.

I suspect that it may always have done this, perhaps intermittently, but it wasn't noticed. Even with those error messages the process still runs and the router is discoverable using WSD via UDP.

EDIT: Further testing of the Entware version using its debug option confirms that it is binding itself to *all* interfaces, including the WAN interface. So this is probably not something you want to be running on a router from a security perspective. This is one of the improvements that Merlin made to his version.
 
Last edited:
wsdd2 requires a number of changes to work properly on Asuswrt. I doubt many of these changes were made to the Entware package.

1) Asuswrt (and Asuswrt-Merlin) do not ship with testparam, which means wsdd2 from Entware will not be able to retrieve the proper workgroup and machine name unless you have a testparam version installed through your own Samba package. I modified my version of wsdd2 to replace the testparam call with custom code that parses the smb.conf at the location used by Asuswrt-Merlin.

2) By default, wsdd2 binds to every single network interface, which is a major security risk - as it will also bind to the WAN interface. While the firewall should normally block access to it, it's still risky. I implemented a new parameter that allows one to specify a specific interface to bind to (and themiron later rewrote part of that code to properly ensure it truly bound itself only to that interface).

3) There is currently no way to disable wsdd2 in the firmware. Best you can do is maybe create a bound mount on /usr/sbin/wsdd2 to point to /bin/true or something like that.
 
wsdd2 requires a number of changes to work properly on Asuswrt. I doubt many of these changes were made to the Entware package.

1) Asuswrt (and Asuswrt-Merlin) do not ship with testparam, which means wsdd2 from Entware will not be able to retrieve the proper workgroup and machine name unless you have a testparam version installed through your own Samba package. I modified my version of wsdd2 to replace the testparam call with custom code that parses the smb.conf at the location used by Asuswrt-Merlin.

2) By default, wsdd2 binds to every single network interface, which is a major security risk - as it will also bind to the WAN interface. While the firewall should normally block access to it, it's still risky. I implemented a new parameter that allows one to specify a specific interface to bind to (and themiron later rewrote part of that code to properly ensure it truly bound itself only to that interface).

3) There is currently no way to disable wsdd2 in the firmware. Best you can do is maybe create a bound mount on /usr/sbin/wsdd2 to point to /bin/true or something like that.

1) wsdd2 from Entware can use the value of "netbios name = " in /opt/etc/samba/smb.conf, which is provided by samba4 from Entware, as the hostname of the router. But one thing to note, if the value of "netbios name = " is given a value different from the value 'nvram get computer_name' gives, although this value can be broadcast by wsdd2 from Entware, users can never connect to the samba share successfully.

2) Entware offers a testparam version in its samba4 packages.

3) With samba4 from Entware installed on Asuswrt-Merlin 384.12, the wsdd2 from Asuswrt-Merlin 384.12 can't use the value of "netbios name = " in /opt/etc/samba/smb.conf, which is provided by samba4 from Entware, for broadcast. It seems that the wsdd2 from Asuswrt-Merlin 384.12 will use the value 'nvram get computer_name' gives automatically. This test is done with samba from Asuswrt-Merlin 384.12 disabled and samba from Entware enabled.

4) Since both wsdd2 from Entware and wsdd2 from Asuswrt-Merlin 384.12 use the same value 'nvram get computer_name' gives, now it is OK to use wsdd2 from Asuswrt-Merlin 384.12 with samba4 from Entware with everything going well. In my project, I use the codes below to circumvent the issue I post.


# Start wsdd2
if [ -e /usr/sbin/wsdd2 ]
then
# If /usr/sbin/wsdd2 exists, invoke it
/usr/sbin/wsdd2 -d -w
#
else
# If /usr/sbin/wsdd2 doesn't exist, invoke /usr/sbin/wsdd2
/opt/bin/wsdd2 -d -w
fi
#
 
Last edited:
1) wsdd2 from Entware can use the value of "netbios name = " in /opt/etc/samba/smb.conf, which is provided by samba4 from Entware, as the hostname of the router. But one thing to note, if the value of "netbios name = " is given a value different from the value 'nvram get computer_name' gives, although this value can be broadcast by wsdd2 from Entware, users can never connect to the samba share successfully.

2) Entware offers a testparam version in its samba4 packages.

3) With samba4 from Entware installed on Asuswrt-Merlin 384.12, the wsdd2 from Asuswrt-Merlin 384.12 can't use the value of "netbios name = " in /opt/etc/samba/smb.conf, which is provided by samba4 from Entware, for broadcast. It seems that the wsdd2 from Asuswrt-Merlin 384.12 will use the value 'nvram get computer_name' gives automatically. This test is done with samba from Asuswrt-Merlin 384.12 disabled and samba from Entware enabled.

4) Since both wsdd2 from Entware and wsdd2 from Asuswrt-Merlin 384.12 use the same value 'nvram get computer_name' gives, now it is OK to use wsdd2 from Asuswrt-Merlin 384.12 with samba4 from Entware with everything going well. In my project, I use the codes below to circumvent the issue I post.

Code:
# Start wsdd2
# 启动wsdd2
if [ -e /usr/sbin/wsdd2 ]
then
    # If /usr/sbin/wsdd2 exists, invoke it
    # 如果文件/usr/sbin/wsdd2存在,则执行它
    /usr/sbin/wsdd2 -d -w
    #
else
    # If /usr/sbin/wsdd2 doesn't exist, invoke /usr/sbin/wsdd2
    # 如果文件/usr/sbin/wsdd2不存在,则执行/usr/sbin/wsdd2
    /opt/bin/wsdd2 -d -w
fi
#

This is great detail you are providing in the text, however, the Code box isn't readable.

Please edit this so it is in English? It really makes no sense right now.
 
It seems that the wsdd2 from Asuswrt-Merlin 384.12 will use the value 'nvram get computer_name' gives automatically.

No, I currently retrieve these two parameters by parsing /etc/smb.conf.
 
Hello!

ASUSWRT-Merlin RT-AC86U 384.12-0

Confirming WORKING and without errors/warning Merlin included in firmware and also Entware version of wsdd2.
Firmware Samba 3 + firmware wsdd2
or
Entware Samba4 + Entware wsdd2

Of course only one pair can run at a time. Now I use a pair from Entware. :)
There were NO modifications except dbus from Entware to run with "admin" user instead of a "root" user.
 
Hello!

ASUSWRT-Merlin RT-AC86U 384.12-0

Confirming WORKING and without errors/warning Merlin included in firmware and also Entware version of wsdd2.
Firmware Samba 3 + firmware wsdd2
or
Entware Samba4 + Entware wsdd2

Of course only one pair can run at a time. Now I use a pair from Entware. :)
There were NO modifications except dbus from Entware to run with "admin" user instead of a "root" user.

As the video shown at #1, I still can't make Entware wsdd2 work under ASUSWRT-Merlin RT-AC68U 384.12-0.:( In order to overcome the issue, I use Entware Samba4 + Firmware wsdd2 instead, which works perfectly.:)
 

Latest threads

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