Re: DHCP IP range + auto hostname



Nagy László wrote:

Hello,

I have a DHCP server with this config file:

option domain-name "cassiopeia.ronet";
option domain-name-servers 192.168.0.1;
default-lease-time 600;
max-lease-time 7200;
authoritative;
log-facility local7;
ddns-update-style none;

subnet 192.168.0.0 netmask 255.255.0.0 {
range 192.168.0.101 192.168.0.139;
option routers 192.168.0.1;
use-host-decl-names on;
option broadcast-address 192.168.0.255;
filename "pxeboot";
option root-path "192.168.0.1:/mnt/d1/rootfs";
}

I would like the diskless machines to set their hostname automatically. I have a working named for this. For example:

cassiopeia# host diskless131.ronet
diskless131.ronet has address 192.168.0.131
cassiopeia# host 192.168.0.131
131.0.168.192.in-addr.arpa domain name pointer diskless131.ronet.
cassiopeia#

Of course I can create individual hosts in the dhcp config file and set their hostnames. But I do not want to create 40 host declarations and look for the hardware addresses by hand... The clients should be able to determine their hostnames using a reverse dns lookup, and the set their hostnames automatically. In the above example: after the machine got its IP address (192.168.0.131) from the DHCP server, it should set its hostname to 'diskless131.ronet'.

Sounds easy, but I do not know how to do that. Is it a standard procedure, or do I need to write a custom script? (Where should I place it?)

IIRC you need to build the kernel for the diskless clients with the BOOTP options (I don't remember which of them right now), this should allow the kernel to rerequest parameters later in the boot stage.

Cheers, Erik

--
Ph: +34.666334818 web: http://www.locolomo.org
X.509 Certificate: http://www.locolomo.org/crt/8D03551FFCE04F0C.crt
Key ID: 69:79:B8:2C:E3:8F:E7:BE:5D:C3:C3:B1:74:62:B8:3F:9F:1F:69:B9
_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • DHCP IP range + auto hostname
    ... option domain-name-servers 192.168.0.1; ... cassiopeia# host diskless131.ronet ... The clients should be able to determine their hostnames using a reverse dns lookup, and the set their hostnames automatically. ... after the machine got its IP address from the DHCP server, it should set its hostname to 'diskless131.ronet'. ...
    (freebsd-questions)
  • Re: Blocking access to a network
    ... The DHCP server can be ... So the host is configured for DHCP for its IP ... The Linksys routers have that ability. ... the Linksys BEFSR41 doesn't have the ability to assign static IP ...
    (comp.security.firewalls)
  • Re: DHCP keeping host names unique
    ... > the DHCP server to only provide addresses to hosts with unique netbios ... > So the objective is to ensure that the host names are unique. ... CONTROL panel (and that the NIC suffixes settings are not ... Accelerated MCSE ...
    (microsoft.public.windows.server.dns)
  • Re: ~/.hosts patch
    ... to hosts as a user or do interesting ssh port forwarding ... feature any user could redirect that host. ... fully-qualified hostnames. ...
    (freebsd-current)
  • Re: Computer host names - recommendations
    ... > I've been searching for some guidelines/recommendations on hostnames. ... in this case a NIS server at an Arizona location. ... As for naming host names by location, I think this is a double-edged ...
    (comp.security.unix)