PDA

View Full Version : SB sends no DHCP host name



0xdeadbeef
2005-12-14, 11:13
When the Squeezebox requests an IP adress from a DHCP server, it doesn't seem to send its own host name.
E.g. in Linux (Debian/Ubuntu), you can send the hostname to the DHCP server by adding the following lines to /etc/dhclient.conf:

send dhcp-client-identifier 00:00:00:00:00:00; // enter mac address here
send host-name "host name"; // change to your host name

Since the Squeezebox doesn't send a host name, it's named "noname" by the DHCP server, which is kinda ugly.

So I'd suggest to send the host name that was entered in the player setup.

kdf
2005-12-14, 11:36
please vote here:
http://bugs.slimdevices.com/show_bug.cgi?id=1264

Marc Sherman
2005-12-14, 12:13
kdf wrote:
> please vote here:
> http://bugs.slimdevices.com/show_bug.cgi?id=1264

Or here, for that matter:
http://bugs.slimdevices.com/show_bug.cgi?id=760

Should one of these be closed as a dupe?

- Marc

kdf
2005-12-14, 12:46
Quoting Marc Sherman <msherman (AT) projectile (DOT) ca>:

> kdf wrote:
>> please vote here:
>> http://bugs.slimdevices.com/show_bug.cgi?id=1264
>
> Or here, for that matter:
> http://bugs.slimdevices.com/show_bug.cgi?id=760
>
> Should one of these be closed as a dupe?

well, one is for reporting a default hostname to teh web isntead of
being unnamed. the other is for reporting a hostname to the dhcp
server.

it could be marked a dupe, but it is probably different enough that one
of them would get upset.

-kdf

Phil Karn
2005-12-15, 02:53
0xdeadbeef wrote:
> When the Squeezebox requests an IP adress from a DHCP server, it doesn't
> seem to send its own host name.
> E.g. in Linux (Debian/Ubuntu), you can send the hostname to the DHCP
> server by adding the following lines to /etc/dhclient.conf:
>
> send dhcp-client-identifier 00:00:00:00:00:00; // enter mac address
> here
> send host-name "host name"; // change to your
> host name
>
> Since the Squeezebox doesn't send a host name, it's named "noname" by
> the DHCP server, which is kinda ugly.
>
> So I'd suggest to send the host name that was entered in the player
> setup.

I do it in a way that doesn't require the Squeezebox to send a host name.

My DHCP server is ISC DHCPD on Linux. /etc/dhcpd.conf has an entry for
every regular host on my LAN, including Squeezeboxes. Each entry
specifies the MAC address and a fixed-address entry for that system. So
each Squeezebox gets the same IP and DNS name address every time it boots.

Here's a sample entry in /etc/dhcpd.conf:

host skinner {
hardware ethernet 00:04:20:06:1a:56;
fixed-address skinner.local.ka9q.net;
}

The zone "local.ka9q.net" contains A records in the 192.168.1/24 subnet
for hosts that don't need global IPv4 addresses. skinner.local.ka9q.net
resolves to 192.168.1.13, so that particular Squeezebox always gets that
same IP address.

The DHCP server keeps a separate pool of IP addresses for clients whose
MAC addresses don't have specific entries (e.g., a visitor's laptop).

--Phil

0xdeadbeef
2005-12-15, 04:07
Unfortunately, in my case the DHCP server is running on my DSL modem/router and there's nothing to configure there. Though it should give the SQ the same IP every time due to MAC caching, I have the feeling it doesn't. Indeed, I observed at least 3 different IP addresses in the few days since I obtained my SQ.
Then again, all devices whith a DHCP name get the same IP all the time.

Phil Karn
2005-12-22, 17:32
0xdeadbeef wrote:
> Unfortunately, in my case the DHCP server is running on my DSL
> modem/router and there's nothing to configure there. Though it should
> give the SQ the same IP every time due to MAC caching, I have the
> feeling it doesn't. Indeed, I observed at least 3 different IP
> addresses in the few days since I obtained my SQ.
> Then again, all devices whith a DHCP name get the same IP all the time.

You really need to trace the packets to know what's really going on, as
I know of at least two different ways that a given host might keep a
stable IP address.

First, the client might cache leases in nonvolatile memory across power
cycles or reboots and simply request the previous IP address when
rebooted. A DHCP server will almost always grant a request for a
specific IP address as long as it's in that server's pool and no other
client has a lease for it.

Second, the server might cache client MAC addresses and previous leases
(expired or still valid) and reassign the previous IP address even when
the client doesn't ask for it.

It's helpful to know the DHCP protocol exchange. A "cold start" looks
like this:

Client: DHCPDISCOVER [who can give me an IP address?]
Server: DHCPOFFER a.b.c.d [I'm a DHCP server, and I can offer you this
address]
Client: DHCPREQUEST a.b.c.d [I'd like to use this address]
Server: DHCPACK a.b.c.d [Okay, you've been officially granted this address]

A booting client that wants to use a previously assigned address will
jump directly to the DHCPREQUEST message. The server can respond with a
DHCPACK as before, or it can respond with a DHCPNAK (negative
acknowledgement), rejecting the request. At this point the client will
fall back to the DHCPDISCOVER step.

Ideally the Squeezebox would save DHCP leases across reboots, and your
DHCP server would hand out very long leases to minimize the chances of
that address being given to another client. But there are other ways to
ensure that a Squeezebox always gets the same IP address, including
bypassing DHCP altogether and assigning a static IP address.

That might be your best bet assuming your Squeezebox doesn't move often.
Just make sure that you set up separate blocks of addresses for static
use and dynamic assignment, so your DHCP server doesn't hand out the
address already in use by your Squeezebox. DHCP clients are supposed to
detect this by ARPing for an assigned address before actually using it,
but it can fail if the conflicting host with the static assignment
happens to be offline at the time.

--Phil



Phil