LINUX.ORG.RU
ФорумAdmin

Не работает DHCP сервер на Ubuntu

 


0

1

Такая проблема, нужно создать сервер с двумя сетями, условно: 192.168.1.0 и 192.168.2.0. Соответственно в первую сеть будут попадать клиенты с Ubuntu, а во вторую сеть клиенты с Windows. Я сделал такое разграничение с помощью опции 60 (vendor-class-identifier), которую клиенты отправляют на сервер, когда хотят получить адрес. Чтобы убунту отправляла опцию 60 я вроде как сделал, смотрел дамп, да, действительно отправляет свой vendor-class. Настроил DHCP-сервер, но почему-то клиентам на винде адреса раздаются, а клиентам на убунте почему-то нет. Сервер при перезапуске, когда показывает логи пишет примерно такое: DHCPDISCOVER from далее MAC-адрес via ens33: network 224-29: no free leases. В чем может быть ошибка? В общем, приложу ниже файл dhcpd.conf и сами логи. Файл dhcpd.conf:

# dhcpd.conf
#
# Sample configuration file for ISC dhcpd
#
# Attention: If /etc/ltsp/dhcpd.conf exists, that will be used as
# configuration file instead of this file.
#

# option definitions common to all supported networks...
#option domain-name "example.org";
#option domain-name-servers ns1.example.org, ns2.example.org;

default-lease-time 6000;
max-lease-time 7200;

# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-update-style none;

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
#authoritative;

# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
#log-facility local7;

# No service will be given on this subnet, but declaring it helps the 
# DHCP server to understand the network topology.

#subnet 10.152.187.0 netmask 255.255.255.0 {
#}

# This is a very basic subnet declaration.

#subnet 192.168.1.0 netmask 255.255.255.0 {
#  range 192.168.1.150 192.168.1.200;
#  option routers 192.168.1.254;
#  option subnet-mask 255.255.255.0;
#}

# This declaration allows BOOTP clients to get dynamic addresses,
# which we don't really recommend.

#subnet 10.254.239.32 netmask 255.255.255.224 {
#  range dynamic-bootp 10.254.239.40 10.254.239.60;
#  option broadcast-address 10.254.239.31;
#  option routers rtr-239-32-1.example.org;
#}

# A slightly different configuration for an internal subnet.
#subnet 192.168.1.0 netmask 255.255.255.0 {
#  range 192.168.1.150 192.168.1.200;
# option subnet-mask 255.255.255.0;
#option routers 192.168.1.254;
# default-lease-time 6000;
#max-lease-time 7200;
#host DANYA-PC {
#hardware ethernet 18:47:3D:C4:BC:6D;
# fixed-address 192.168.1.190; }    
#}


#subnet 192.168.11.0 netmask 255.255.255.252 {
 # range 192.168.11.253 192.168.11.254;
  #option subnet-mask 255.255.255.0;
  #option routers 192.168.11.254;
#  default-lease-time 6000;
#  max-lease-time 7200;
 # host damn2 {
 # hardware ethernet 00:0C:29:9D:82:3B;
  #fixed-address 192.168.11.254; }
#}

#subnet 192.168.11.0 netmask 255.255.255.0 {
#  range 192.168.11.100 192.168.11.150;
#  option subnet-mask 255.255.255.0;
#  option routers 192.168.11.254;
#  default-lease-time 6000;
#  max-lease time 7200;
#  host DANYA-PC {
 # hardware ethernet 18:47:3D:C4:BC:4B;
 # fixed-address 192.168.11.132; }
#}
  
# Hosts which require special configuration options can be listed in
# host statements.   If no address is specified, the address will be
# allocated dynamically (if possible), but the host-specific information
# will still come from the host declaration.

#host passacaglia {
#  hardware ethernet 0:0:c0:5d:bd:95;
#  filename "vmunix.passacaglia";
#  server-name "toccata.example.com";
#}

# Fixed IP addresses can also be specified for hosts.   These addresses
# should not also be listed as being available for dynamic assignment.
# Hosts for which fixed IP addresses have been specified can boot using
# BOOTP or DHCP.   Hosts for which no fixed address is specified can only
# be booted with DHCP, unless there is an address range on the subnet
# to which a BOOTP client is connected which has the dynamic-bootp flag
# set.
#host fantasia {
#  hardware ethernet 08:00:07:26:c0:a5;
#  fixed-address fantasia.example.com;
#}

# You can declare a class of clients and then do address allocation
# based on that.   The example below shows a case where all clients
# in a certain class get addresses on the 10.17.224/24 subnet, and all
# other clients get addresses on the 10.0.29/24 subnet.

#class "foo" {
#  match if substring (option vendor-class-identifier, 0, 4) = "SUNW";
#}
class "linux_subnet" {
	match if substirng (option vendor-class-identifier, 0, 6) = "Ubuntu";
}

class "windows_subnet" {
	match if substring (option vendor-class-identifier, 0, 9) = "MSFT 5.0";
}

shared-network 224-29 {
  subnet 192.168.1.0 netmask 255.255.255.0 {
    option routers 192.168.1.254;
  }
  subnet 192.168.2.0 netmask 255.255.255.0 {
    option routers 192.168.2.254;
  }
  pool {
    allow members of "linux_subnet";
    range 192.168.1.100 192.168.1.230;
  }
  pool {
    allow members of "windows_subnet";
    range 192.168.2.100 192.168.2.149;
  }
}

Что пишется в логи:

ноя 04 18:51:25 damn dhcpd[4298]: substirng: no such function.
ноя 04 18:51:25 damn dhcpd[4298]: DHCPDISCOVER from 00:0c:29:9d:82:3b via ens33: network 224-29: no free leases
ноя 04 18:51:37 damn dhcpd[4298]: substirng: no such function.
ноя 04 18:51:37 damn dhcpd[4298]: DHCPDISCOVER from 00:0c:29:9d:82:3b via ens33: network 224-29: no free leases
ноя 04 18:55:38 damn dhcpd[4298]: substirng: no such function.
ноя 04 18:55:38 damn dhcpd[4298]: DHCPREQUEST for 192.168.0.100 from 00:0c:29:77:3e:f9 via ens33: ignored (not authoritative).
ноя 04 18:55:38 damn dhcpd[4298]: substirng: no such function.
ноя 04 18:55:38 damn dhcpd[4298]: DHCPDISCOVER from 00:0c:29:77:3e:f9 via ens33: network 224-29: no free leases
ноя 04 18:55:39 damn dhcpd[4298]: substirng: no such function.
ноя 04 18:55:39 damn dhcpd[4298]: DHCPREQUEST for 192.168.116.139 (192.168.116.254) from 00:0c:29:77:3e:f9 via ens33: ignored (not authoritative).


Ответ на: комментарий от thesis

Да все, я исправил, вот только конфиг всегда сохранялся и сервер перезагружался и самое главное он даже был активен. Винде то адреса раздавались. Видимо на такую ошибку он не сильно ругается и все равно запускает сервер

dssd0
() автор топика
Ответ на: комментарий от dssd0

конфиг всегда сохранялся и сервер перезагружался

Это меня уже самого приглючило, что в конфиге опечатки нет, а есть только в логе. А она и в конфиге есть.
Исправление повлияло на что-нибудь?

thesis ★★★★★
()
Ответ на: комментарий от thesis

Не не не. В логах все правильно написано было. В конфиге слово было написано неправильно. Но при этом сервер все равно функционировал и раздавал адреса для винды. Соответственно я увидел эту ошибку и исправил ее также перезагрузил и всё заработало и винде и линухе адреса раздаются

dssd0
() автор топика