I have an OpenWRT router that also does light duty as a central home
server (mostly for doing backups & serving music to my stereo system.)
The box's (local) IP address has two (local) hostnames, for its two
different purposes, so I can split the functionality onto two
different machines later, if I wish: router.local and home.local. The
true hostname of the box is "router."
I'd like the samba system to advertise its shares under the name
"home," not "router." I've run into two problems here.
First, I note that the smb.conf.template file sets the advertised
netbios name with this entry:
...
netbios name = |NAME|
...
The |NAME|
bit is a template field that is supposed to be filled in by a
uci entry in /etc/config/samba4
:
config samba
option name home
If unspecified, it defaults to the machine's hostname, which (in my
case) is "router," not "home." But the uci mechanism is not working for
me: when I set the name
option to home
in /etc/config/samba4
(as
shown above) and restart the server, it does not use this setting
when it constructs the actual config file in /var/etc/smb.conf
. I
can set the uci name
option to anything I want, and the host name
"router" will still be substituted for |NAME|
when
/var/etc/smb.conf
is constructed.
Am I doing something wrong? How do set the |NAME|
substitution in the
smb.config.template
file? I know that I can simply hack the template
itself to crowbar the setting by removing the |NAME|
reference entirely,
but that seems like the wrong thing to do. I'd prefer to use the uci
machinery correctly, as it is clearly specifically designed for this task.
(While I am writing, it also seems odd that the luci interface provides
no way to set this parameter. You have to do it with uci.)
The second thing I would like to do is advertise/publish the shares
under the name "home" to client machines that run linux & OS X. Using
the "Files" file browser in Ubuntu, I can go to the network:///
location and see servers offering shares. My router shows up as server
"router". The actual text url behind the friendly icon in Files is
network:///dnssd-domain-router._smb._tcp
(where the "router" part is, presumably, the host name of the system
offering the service.)
Can someone point me to a document on the OpenWRT site that will
tell me how to alter the DNS-SD advertisement for this service to use
the alternate host name?
EKH