Host name not broadcast to DHCP

Kernels & Hardware, configuring network, installing services

Host name not broadcast to DHCP

Postby Kevin Seise » 2010-12-21 01:56

I have setup a few machines within my house. The Debian Squeeze machines do not provide a host name in the DHCP client list on my router. Strangely, my Ubuntu, Android, and Blackberry machines do show host names. I have noticed the same behavior when wirelessly tethering my Debian laptop to my Android phone (which also uses DHCP). Is there something I need to enable to have the name show up on the router?
Kevin Seise
 
Posts: 122
Joined: 2009-09-12 13:21
Location: New Jersey, USA

Re: Host name not broadcast to DHCP

Postby chpln » 2010-12-21 06:37

The easiest way to resolve this may be to use dhcpcd over ddclient. I believe the former sends the hostname of the client by default.
chpln
 
Posts: 27
Joined: 2010-08-12 09:18
Location: Australia

Re: Host name not broadcast to DHCP

Postby Kevin Seise » 2010-12-22 01:08

I actually have dhcp3-client installed. I guess that is the default setup. I edited the /etc/dhclient.conf file to broadcast the host-name and restarted the dhclient package, but that didn't work. Any other ideas?
Kevin Seise
 
Posts: 122
Joined: 2009-09-12 13:21
Location: New Jersey, USA

Re: Host name not broadcast to DHCP

Postby chpln » 2010-12-22 06:54

Sorry, ddclient was a typo on my part. It was meant to read dhcp3-client.
chpln
 
Posts: 27
Joined: 2010-08-12 09:18
Location: Australia

Re: Host name not broadcast to DHCP

Postby ripat » 2010-12-22 07:06

First install the tcpdump package from the repo if not installed yet. Then, open a console and run as root:
Code: Select all
# tcpdump -vvvn port bootps


In another console run:
Code: Select all
# dhclient -v

And post the result of the tcpdump here.
I'll try to be a native english speaker... in my next life!
User avatar
ripat
 
Posts: 106
Joined: 2009-12-06 08:46
Location: Belgium

Re: Host name not broadcast to DHCP

Postby drokmed » 2010-12-22 20:38

and

Code: Select all
# cat /etc/hostname
User avatar
drokmed
 
Posts: 1094
Joined: 2007-10-03 19:24
Location: Saint Petersburg, FL

Re: Host name not broadcast tobl DHCP

Postby Kevin Seise » 2010-12-23 01:10

ripat wrote:First install the tcpdump package from the repo if not installed yet. Then, open a console and run as root:
Code: Select all
# tcpdump -vvvn port bootps


In another console run:
Code: Select all
# dhclient -v

And post the result of the tcpdump here.


I think the second command forced my box to change its ip address from the static ip I had set and pickup a new address from the DHCP server. Once I found it again, I got the following results:

Code: Select all
# tcpdump -vvvn port bootps
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes


Code: Select all
# cat /etc/hostname
blackbox
which is correct.

rebooting puts the system back at the right address, but everytime I run dhclient -v, the machine switches ip addresses and I lose connection.
Kevin Seise
 
Posts: 122
Joined: 2009-09-12 13:21
Location: New Jersey, USA

Re: Host name not broadcast to DHCP

Postby Kevin Seise » 2010-12-23 01:36

Disregard my last post. I suddenly realized the need to run the commands locally.
Code: Select all
# tcpdump -vvvn port bootps
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
20:27:57.003964 IP (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
    0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 00:1f:c6:0d:88:c9, length 300, xid 0x67ab347c, Flags [none] (0x0000)
     Client-Ethernet-Address 00:1f:c6:0d:88:c9
     Vendor-rfc1048 Extensions
       Magic Cookie 0x63825363
       DHCP-Message Option 53, length 1: Request
       Requested-IP Option 50, length 4: 192.168.2.11
       Hostname Option 12, length 8: "blackbox"
       Parameter-Request Option 55, length 13:
         Subnet-Mask, BR, Time-Zone, Default-Gateway
         Domain-Name, Domain-Name-Server, Option 119, Hostname
         Netbios-Name-Server, Netbios-Scope, MTU, Classless-Static-Route
         NTP
       END Option 255, length 0
       PAD Option 0, length 0, occurs 25
20:27:57.005234 IP (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 314)
    192.168.2.1.67 > 192.168.2.11.68: [udp sum ok] BOOTP/DHCP, Reply, length 286, xid 0x67ab347c, Flags [none] (0x0000)
     Your-IP 192.168.2.11
     Client-Ethernet-Address 00:1f:c6:0d:88:c9
     Vendor-rfc1048 Extensions
       Magic Cookie 0x63825363
       DHCP-Message Option 53, length 1: ACK
       Server-ID Option 54, length 4: 192.168.2.1
       Lease-Time Option 51, length 4: 86400
       Subnet-Mask Option 1, length 4: 255.255.255.0
       Default-Gateway Option 3, length 4: 192.168.2.1
       Domain-Name-Server Option 6, length 16: 192.168.2.1,208.67.222.222,208.67.220.220,167.206.245.130
       END Option 255, length 0
20:27:57.005730 IP (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 314)
    192.168.2.1.67 > 192.168.2.11.68: [udp sum ok] BOOTP/DHCP, Reply, length 286, xid 0x67ab347c, Flags [none] (0x0000)
     Your-IP 192.168.2.11
     Client-Ethernet-Address 00:1f:c6:0d:88:c9
     Vendor-rfc1048 Extensions
       Magic Cookie 0x63825363
       DHCP-Message Option 53, length 1: ACK
       Server-ID Option 54, length 4: 192.168.2.1
       Lease-Time Option 51, length 4: 86400
       Subnet-Mask Option 1, length 4: 255.255.255.0
       Default-Gateway Option 3, length 4: 192.168.2.1
       Domain-Name-Server Option 6, length 16: 192.168.2.1,208.67.222.222,208.67.220.220,167.206.245.130
       END Option 255, length 0
20:29:17.002491 IP (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
    0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 00:1f:c6:0d:88:c9, length 300, xid 0xdf4d2b41, Flags [none] (0x0000)
     Client-Ethernet-Address 00:1f:c6:0d:88:c9
     Vendor-rfc1048 Extensions
       Magic Cookie 0x63825363
       DHCP-Message Option 53, length 1: Request
       Requested-IP Option 50, length 4: 192.168.2.11
       Hostname Option 12, length 8: "blackbox"
       Parameter-Request Option 55, length 13:
         Subnet-Mask, BR, Time-Zone, Default-Gateway
         Domain-Name, Domain-Name-Server, Option 119, Hostname
         Netbios-Name-Server, Netbios-Scope, MTU, Classless-Static-Route
         NTP
       END Option 255, length 0
       PAD Option 0, length 0, occurs 25
20:29:17.003751 IP (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 314)
    192.168.2.1.67 > 192.168.2.11.68: [udp sum ok] BOOTP/DHCP, Reply, length 286, xid 0xdf4d2b41, Flags [none] (0x0000)
     Your-IP 192.168.2.11
     Client-Ethernet-Address 00:1f:c6:0d:88:c9
     Vendor-rfc1048 Extensions
       Magic Cookie 0x63825363
       DHCP-Message Option 53, length 1: ACK
       Server-ID Option 54, length 4: 192.168.2.1
       Lease-Time Option 51, length 4: 86400
       Subnet-Mask Option 1, length 4: 255.255.255.0
       Default-Gateway Option 3, length 4: 192.168.2.1
       Domain-Name-Server Option 6, length 16: 192.168.2.1,208.67.222.222,208.67.220.220,167.206.245.130
       END Option 255, length 0
20:29:17.004220 IP (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 314)
    192.168.2.1.67 > 192.168.2.11.68: [udp sum ok] BOOTP/DHCP, Reply, length 286, xid 0xdf4d2b41, Flags [none] (0x0000)
     Your-IP 192.168.2.11
     Client-Ethernet-Address 00:1f:c6:0d:88:c9
     Vendor-rfc1048 Extensions
       Magic Cookie 0x63825363
       DHCP-Message Option 53, length 1: ACK
       Server-ID Option 54, length 4: 192.168.2.1
       Lease-Time Option 51, length 4: 86400
       Subnet-Mask Option 1, length 4: 255.255.255.0
       Default-Gateway Option 3, length 4: 192.168.2.1
       Domain-Name-Server Option 6, length 16: 192.168.2.1,208.67.222.222,208.67.220.220,167.206.245.130
       END Option 255, length 0



and then

Code: Select all
dhclient -v
Internet Systems Consortium DHCP Client 4.1.1-P1
Copyright 2004-2010 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/00:1f:c6:0d:88:c9
Sending on   LPF/eth0/00:1f:c6:0d:88:c9
Sending on   Socket/fallback
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPACK from 192.168.2.1
bound to 192.168.2.11 -- renewal in 39512 seconds.


and
Code: Select all
#cat /etc/hostname
blackbox


Obviously the hostname is blackbox. It should be set to a static ip of 192.168.2.2.
Kevin Seise
 
Posts: 122
Joined: 2009-09-12 13:21
Location: New Jersey, USA

Re: Host name not broadcast to DHCP

Postby ripat » 2010-12-23 11:13

Where do you define the static ip of your "blackbox"? In the /etc/network/interfaces file or on the router?
I'll try to be a native english speaker... in my next life!
User avatar
ripat
 
Posts: 106
Joined: 2009-12-06 08:46
Location: Belgium

Re: Host name not broadcast to DHCP

Postby llivv » 2010-12-23 11:24

both
you set the computer static IP address in
/etc/network/interfaces
to an IP address that is available from the router
but is not in the routers DHCP pool of IP addresses...
in the kitchen with Julia ....
[...]
Get on the D bus to B Can ....
[...]
User avatar
llivv
 
Posts: 5561
Joined: 2007-02-14 18:10
Location: will O' the tree hug

Re: Host name not broadcast to DHCP

Postby Kevin Seise » 2010-12-23 13:56

Thank you both! I had set it up in /etc/network/interfaces during the initial installation and made sure that it was there. I just went back in to the router to verify what livv had said and found the correct location within the router to set a static IP. Strangely, I didn't have to do that in Ubuntu. This setup has worked for about 4 years. I had set the DHCP client list to start above the range I wanted my static clients to be on so that if something knocked a static client off, I would only have to fix one connection. I set the static IP on the router and now I am good to go. Everything is working perfectly! Thank you! :D
Kevin Seise
 
Posts: 122
Joined: 2009-09-12 13:21
Location: New Jersey, USA

Re: Host name not broadcast to DHCP

Postby ripat » 2010-12-23 14:06

You can also force your DHCP server to allocate the same IP to one machine based on its MAC address. In that case you keep the iface eth0 inet dhcp line in the interfaces file. Doing that will force your machine to send the DHCP request containing your hostname (Option 12 in the tcpdump that shows that the hostname is correctly sent) to the router/DHCP server. This said, the hostnames from your other devices might be broadcasted by another multicast service like Bonjour or Avahi that could not be running on your Debian.

Edit:

Sorry didn't notice you solved the problem. Well done!
I'll try to be a native english speaker... in my next life!
User avatar
ripat
 
Posts: 106
Joined: 2009-12-06 08:46
Location: Belgium

Re: Host name not broadcast to DHCP

Postby Kevin Seise » 2010-12-23 14:14

ripat,
Thanks for responding. I was leaving this marked as unsolved because this only fixes one issue with one router. I run into the same problem with a laptop which I carry around all the time. Your suggestion of avahi is intriguing and I will give it a shot. The avahi-daemon package is already installed, but I will have to play around a bit to see what works. It will be a few days before I can try it out.
Kevin Seise
 
Posts: 122
Joined: 2009-09-12 13:21
Location: New Jersey, USA

Re: Host name not broadcast to DHCP

Postby llivv » 2010-12-23 15:17

with a roaming laptop the /etc/network/interfaces config is a bit different

I don't use it so I'm only parroting what I've read in the forum

instead of
auto eth0
it's
allow-hotplug eth0

their are others changes that need to be made to the config, but iirc you can setup roaming in the interfaces file...
there may still be some instructions at
/usr/share/doc/ifupdown/examples
Last edited by llivv on 2010-12-23 15:22, edited 1 time in total.
in the kitchen with Julia ....
[...]
Get on the D bus to B Can ....
[...]
User avatar
llivv
 
Posts: 5561
Joined: 2007-02-14 18:10
Location: will O' the tree hug

Re: Host name not broadcast to DHCP

Postby Kevin Seise » 2010-12-23 15:20

llivv wrote:with a roaming laptop the /etc/network/interfaces config is a bit different

I don't use it so I'm only parroting what I've read in the forum

instead of
auto eth0
it's
allow-hotplug eth0

their are others changes that need to be made to the config, but iirc you can setup roaming in the interfaces file...


Thank you. The roaming part is configured correctly during the install, it is only the hostname broadcast that doesn't happen. When I am on someone elses router, I show up as * and not the hostname. The actual networking works fine though.
Kevin Seise
 
Posts: 122
Joined: 2009-09-12 13:21
Location: New Jersey, USA

Next

Return to System configuration

Who is online

Users browsing this forum: No registered users and 12 guests

fashionable