sm1ly
@sm1ly
beardman

Как установить hostname системы, получив его от dhcpd?

Все делается на centos 6.5.

Кусок настройки dhcdp

host mon1 {
        hardware ethernet 00:50:56:b4:5a:39;
        fixed-address 10.60.0.110;
        option domain-name         "abboom.world";
        option host-name "mon1";
        ddns-hostname "mon1.abboom.world";
}


dhclient-eth0.leases:

lease {
  interface "eth0";
  fixed-address 10.60.0.110;
  option subnet-mask 255.255.255.0;
  option dhcp-lease-time 300;
  option dhcp-message-type 5;
  option dhcp-server-identifier 10.60.0.3;
  option host-name "mon1";
  renew 1 2014/04/21 19:21:21;
  rebind 1 2014/04/21 19:23:30;
  expire 1 2014/04/21 19:24:08;
}
lease {
  interface "eth0";
  fixed-address 10.60.0.110;
  option subnet-mask 255.255.255.0;
  option dhcp-lease-time 300;
  option dhcp-message-type 5;
  option dhcp-server-identifier 10.60.0.3;
  option host-name "mon1";
  renew 1 2014/04/21 19:22:09;
  rebind 1 2014/04/21 19:24:21;
  expire 1 2014/04/21 19:24:59;
}
lease {
  interface "eth0";
  fixed-address 10.60.0.110;
  option subnet-mask 255.255.255.0;
  option dhcp-lease-time 300;
  option dhcp-message-type 5;
  option dhcp-server-identifier 10.60.0.3;
  option host-name "mon1";
  renew 1 2014/04/21 19:24:10;
  rebind 1 2014/04/21 19:26:31;
  expire 1 2014/04/21 19:27:09;
}


ну и соответственно
dhclient-eth0.conf:

send vendor-class-identifier "anaconda-Linux 2.6.32-431.el6.x86_64 x86_64";
timeout 45;
request host-name;

[root@tmpcentos65 dhclient]# hostname
tmpcentos65
[root@tmpcentos65 dhclient]# hostname -s
tmpcentos65

Как мне заставить это чудо кушать хостнейм от dhcpd?
  • Вопрос задан
  • 2833 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы