DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2011-07-30 14:14:27

GailH
Member
Registered: 2010-12-13
Posts: 21

How to refer to Windows shares by name (from the DNS-323)?

Hi experts - I hope you can help me with this (possibly trivial) question (I think it's basic Samba):

I have a small home Windows network, comprising:
1. A WinXP SP2 pc (let's call it "Venus"), (whose IP address is: 192.168.0.50)
2. A Windows 7 x64 pc (let's call it "Mars"), (whose IP address is: 192.168.0.52) and
3. a DNS-323 running ffp 0.5 that I'm accessing via Telnet. (It shows on the network as: "dlink-85ab12")
All on a workgroup called: "Sun".

My question is: how do I refer to the Windows PCs from the DNS-323 box, using their share names (aka "UNC names"), without writing an explicit /etc/hosts file.
In other words: in the Telnet shell, when I go: "ping Venus" or "ping mars" is says: "bad address: venus", or: bad address: mars. When I go: "ping 192.168.0.50", or: "ping 8.8.8.8" or: "ping av.com" (ping to the Internet), it works fine.

More info:

1. There is also a router (whose IP address is: 192.168.0.1) serving as the Internet Gateway for the entire SOHO network, also serving as the DHCP server and DNS resolver.

2. On "Mars", going: nbtstat -a dlink-85ab12
I get:

Local Area Connection: Node IpAddress: [192.168.0.52] Scope Id: []

           NetBIOS Remote Machine Name Table

       Name               Type         Status
    --------------------------------------------
    DLINK-85ab12      <00>  UNIQUE      Registered
    DLINK-85ab12      <03>  UNIQUE      Registered
    DLINK-85ab12      <20>  UNIQUE      Registered
    ..__MSBROWSE__.<01>  GROUP       Registered
    SUN       <1D>  UNIQUE     Registered
    SUN       <1E>  GROUP       Registered
    SUN       <00>  GROUP       Registered

    MAC Address = 00-00-00-00-00-00

3. On "Mars", using "LanScan", I get:

LANscanner v1.3 - ScottiesTech.Info
Scanning LAN...

VENUS                 192.168.0.50  00-24-81-48-28-91  SUN   
DLINK-85ab12      192.168.0.53  00-00-00-00-00-00  SUN   MASTER
MARS                  192.168.0.52  00-27-0E-04-42-FF  SUN   

So it seems that Samba is up and working fine on the DNS-323, serving as the master browser.
But how do I refer to the Windows PC's by name, from the DNS-323?

Offline

 

#2 2011-08-01 11:32:18

Mijzelf
Member / Developer
Registered: 2008-07-05
Posts: 709

Re: How to refer to Windows shares by name (from the DNS-323)?

Do you have DHCP enabled on your workstations? In my network my router handles this functionality. All computers (including my Windows PC) add their hostname to their DHCP request, and the DHCP server/DNS relay/DNS server  (dnsmasq) keeps track of all computers which have an assigned IP address. The DNS server will give the ip addresses on hostname.

On the NAS you can get the ip address of a Samba device by using the 'nmblookup' function. But I'm not aware of a way to expand this to default DNS lookup requests.

Offline

 

#3 2011-08-01 17:53:18

FunFiler
Member
Registered: 2010-05-23
Posts: 577

Re: How to refer to Windows shares by name (from the DNS-323)?


3 * (DNS-323 with 2 * 2TB) = 12TB Running FW v1.08 & FFP v0.5
Useful Links: Transmission, Transmission Remote, Automatic

Offline

 

#4 2011-08-01 20:33:00

GailH
Member
Registered: 2010-12-13
Posts: 21

Re: How to refer to Windows shares by name (from the DNS-323)?

Mijzelf wrote:

Do you have DHCP enabled on your workstations?... etc.

DHCP is anabled on the Windows workstation, and yes, the router is the DHCP server.

On the NAS you can get the ip address of a Samba device by using the 'nmblookup' function.

On the NAS, when I go: "nmblookup", it says: "/ffp/bin/sh: nmblookup: not found".

Note  that the problem is not with the Windows workstations, but that the NAS is not resolving the Windows share names ("UNC names"). After much Googling, I found that I have to install the "winbinds" package. Can anyone explain to me how to install the winbinds package on the NAS?

TIA - Gail

Last edited by GailH (2011-08-01 20:36:32)

Offline

 

#5 2011-08-01 20:35:28

GailH
Member
Registered: 2010-12-13
Posts: 21

Re: How to refer to Windows shares by name (from the DNS-323)?

FunFiler: the issue is covered there, but not solved - the open question is: how do you install the "winbinds" package on the NAS (on DNS-323)?
Can you help?

TIA - Gail

Last edited by GailH (2011-08-01 20:36:55)

Offline

 

#6 2011-08-01 20:46:42

FunFiler
Member
Registered: 2010-05-23
Posts: 577

Re: How to refer to Windows shares by name (from the DNS-323)?

As far as i am aware all the simple, valid and possible solutions have been covered in the DLink forum. The solution presented there is far simpler than porting and compiling another package which may very well require installing a different (debian) version of Linux on your NAS. Run static IP addresses.


3 * (DNS-323 with 2 * 2TB) = 12TB Running FW v1.08 & FFP v0.5
Useful Links: Transmission, Transmission Remote, Automatic

Offline

 

#7 2011-08-01 21:22:56

GailH
Member
Registered: 2010-12-13
Posts: 21

Re: How to refer to Windows shares by name (from the DNS-323)?

FunFiler wrote:

... Run static IP addresses.

Static IP addresses (in a "hosts" file) can be inconvenient, since, from time to time PCs may be added to the LAN, (or dropped), and then you have to manually edit the "hosts" file. Also, the DHCP server may change the PCs IP addresses dynamically. So this solution is insufficient. The "Windbinds" package does this automatically.

The solution presented there is far simpler than porting and compiling another package which may very well require installing a different (debian) version of Linux on your NAS.

I don't think that for every new package you need to install Debian Linux on the NAS.
Adding new functionality to Fun_Plug is a legitimate need. I think it's covered in the documentation - the problem is, I am a Linux newbie, so I don't understand how to add the "windbinds" package (which is necessary in this case).

Last edited by GailH (2011-08-01 21:23:50)

Offline

 

#8 2011-08-01 21:56:34

Mijzelf
Member / Developer
Registered: 2008-07-05
Posts: 709

Re: How to refer to Windows shares by name (from the DNS-323)?

nmblookup is inside Fonz' FFP samba-packet. But I must admit that I don't know if it will work with the firmware samba, maybe you'll have to use the whole packet.
BTW, there is also a binary winbindd in the packet.

Offline

 

#9 2011-08-03 22:55:11

GailH
Member
Registered: 2010-12-13
Posts: 21

Re: How to refer to Windows shares by name (from the DNS-323)?

Mijzelf wrote:

nmblookup is inside Fonz' FFP samba-packet. But I must admit that I don't know if it will work with the firmware samba, maybe you'll have to use the whole packet. BTW, there is also a binary winbindd in the packet.

Mijzelf: Thank you for discovering this to me. I have downloaded samba-3.3.2.1 and installed it using funpkg -i.

But now when I go: "wbinfo -N PCname", it says: "wbinfo: error opening config file /ffp/etc/samba/smb.conf. Error was No such file or directory". (it gives this error on several other Samba commands).

It turns out that funpkg has installed smb.conf at /etc/samba/, while it seems that the system is expecting it at: /ffp/etc/samba.

What to do? Thanks, Gail

Last edited by GailH (2011-08-04 02:05:28)

Offline

 

#10 2011-08-03 23:12:59

Mijzelf
Member / Developer
Registered: 2008-07-05
Posts: 709

Re: How to refer to Windows shares by name (from the DNS-323)?

GailH wrote:

It turns out that funpkg has installed smb.conf at /etc/samba/, while it seems that the system is expecting it at: /ffp/etc/samba.

I don't think so. /etc/samba/smb.conf is the configuration file of the firmware samba. Fonz' samba package doesn't contain a /ffp/etc/samba/smb.conf. The conf file is in /ffp/etc/examples/, and you'll have to copy/move it to use it for the ffp-samba daemon.

You can try to create a symlink to the firmware samba folder:

Code:

rm -rf /ffp/etc/samba
ln -s /etc/samba /ffp/etc/samba

Maybe this satisfies all ffp-samba tools.

Offline

 

#11 2011-08-05 09:28:59

GailH
Member
Registered: 2010-12-13
Posts: 21

Re: How to refer to Windows shares by name (from the DNS-323)?

Experts: thank you for your help so far. Here is the problem now:

I have installed samba version 3.3.2, using funpkg. When I go: "wbinfo -V", it says: "3.3.2". Also, smbd, nmbd and winbindd are up. I can even go: "wbinfo -N venus" (where venus is a Windows UNC pc host name on the LAN), and it responds: "192.168.0.12" (which is venus' IP address).

But, when I go: "ping venus", it says: "ping: bad address: venus", and in the log file: ffp/var/log/samba/log.winbindd
it says:
"winbindd/winbindd.c:request_len_recv(616)
request_len_recv: Invalid request size received: 1844 (expected 2096)"

When I try to copy a file from the Windows PC to the NAS, going:
rsync -v "venus:e/my Documents/Temp/a.txt ." (where a.txt is the file I'd like to copy), it says:
"ssh: Could not resolve hostname venus: Name or service not known",
and in: ffp/var/log/samba/log.winbindd it says again:
"winbindd/winbindd.c:request_len_recv(616)
request_len_recv: Invalid request size received: 1844 (expected 2096)"

How to fix this?

Thanks in advance - Gail

Some more info: Afer installing samba 3.3.2, smbd and nmbd do not start on their own, and I have to go: "smb start" - then they start fine.
To start winbindd, I also have to go: "winbindd", and then the windbind daemon starts and stays up.
I can even go: "wbinfo -N venus" (where venus is a Windows UNC pc host name on the LAN), and it responds: "192.168.0.12" (which is venus' IP address).
When I go: "nmblookup venus", it responds:
"querying venus on 192.168.0.255
192.168.0.12 venus<00>"

mijzelf said: You can try to create a symlink to the firmware samba folder:
rm -rf /ffp/etc/samba
ln -s /etc/samba /ffp/etc/samba
Maybe this satisfies all ffp-samba tools

mijzelf: thank you for this important suggestion. I did that, and it enabled me to reach this stage.

Last edited by GailH (2011-08-05 09:47:04)

Offline

 

#12 2011-08-05 11:49:55

Mijzelf
Member / Developer
Registered: 2008-07-05
Posts: 709

Re: How to refer to Windows shares by name (from the DNS-323)?

GailH wrote:

How to fix this?

I suppose your ultimate goal is to run rsync using netbios names? You can use the output of wbinfo in the command line:

Code:

ping ` wbinfo -N venus `

You'll have to check what the output of wbinfo is when venus is not online, or non-existant. It might screw up your rsync command line.

Offline

 

#13 2011-08-05 12:17:20

GailH
Member
Registered: 2010-12-13
Posts: 21

Re: How to refer to Windows shares by name (from the DNS-323)?

Mijzelf wrote: I suppose your ultimate goal is to run rsync using netbios names?

Exactly. The goal is to run rsync using netbios ("UNC") hostnames.

You can use the output of wbinfo in the command line: ping `wbinfo -N venus`

Thank you, Mijzelf. This is a smart workaround. Still, I would like to fix the core problem. Googling around, I've found that the problem is probably due to library version mismatch between winbindd and the installed samba (and /or nsswitch?)
Can you suggest a way to make sure the library versions match? How to go about finding the relevant libraries and their versions?

TIA

Gail

Offline

 

#14 2011-08-05 15:45:05

FunFiler
Member
Registered: 2010-05-23
Posts: 577

Re: How to refer to Windows shares by name (from the DNS-323)?

You can add statements to /ffp/etc/fun_plug.local and they will get executed on startup for the services that don't start or build start/stop scripts in /ffp/start.


3 * (DNS-323 with 2 * 2TB) = 12TB Running FW v1.08 & FFP v0.5
Useful Links: Transmission, Transmission Remote, Automatic

Offline

 

#15 2011-08-05 15:46:18

FunFiler
Member
Registered: 2010-05-23
Posts: 577

Re: How to refer to Windows shares by name (from the DNS-323)?

To list the libraries associated with an executable, use the 'ldd' command.


3 * (DNS-323 with 2 * 2TB) = 12TB Running FW v1.08 & FFP v0.5
Useful Links: Transmission, Transmission Remote, Automatic

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB