ga6iem Posted September 7, 2011 Posted September 7, 2011 Настраиваю релеем DES-3200 к DHCP 4.1 DES-3200-28:5#show dhcp_relay Command: show dhcp_relay DHCP/BOOTP Relay Status : Enabled DHCP/BOOTP Hops Count Limit : 4 DHCP/BOOTP Relay Time Threshold : 0 DHCP Relay Agent Information Option 82 State : Enabled DHCP Relay Agent Information Option 82 Check : Enabled DHCP Relay Agent Information Option 82 Policy : Replace DHCP Relay Agent Information Option 82 Remote ID : "00-1E-58-6F-03-40" Interface Server 1 Server 2 Server 3 Server 4 ------------ --------------- --------------- --------------- -------------- System 10.0.0.1 dhcpd.conf: ddns-update-style none; default-lease-time 600; max-lease-time 7200; log-facility local7; authoritative; allow unknown-clients; lease-file-name "/var/db/dhcpd.leases"; one-lease-per-client true; deny duplicates; if exists agent.remote-id and exists agent.circuit-id { if binary-to-ascii(16, 8, "", substring(option agent.remote-id, 2, 1)) = "0" { set switch-mac = concat("0", binary-to-ascii(16, 8, "", substring(option agent.remote-id, 2, 1)), ":", binary-to-ascii(16, 8, ":", substring(option agent.remote-id, 3, 6))); } else { set switch-mac = binary-to-ascii(16, 8, ":", substring(option agent.remote-id, 2, 6)); } set switch-addr = binary-to-ascii(10, 8, ".", packet(24, 4)); set switch-port = binary-to-ascii(10, 8, "", substring(option agent.circuit-id, 5, 1)); set switch-port-vlan = binary-to-ascii(10, 16, "", substring(option agent.circuit-id, 2, 2)); log (info, concat("- Lease: ", binary-to-ascii(10, 8, ".", leased-address), " via IP: ", switch-addr, " (MAC: ", switch-mac, ") on port: ", switch-port, " in VLAN: ", switch-port-vlan)); } shared-network dlink { subnet 10.0.0.0 netmask 255.255.255.0 { range 10.0.0.2 10.0.0.90; option broadcast-address 10.0.0.255; option subnet-mask 255.255.255.0; option domain-name-servers 10.0.0.1,8.8.8.8; option routers 10.0.0.1; } subnet 10.20.0.0 netmask 255.255.255.0 { option broadcast-address 10.20.0.255; option subnet-mask 255.255.255.0; option domain-name-servers 10.20.0.1,8.8.8.8; option routers 10.20.0.1; class "port22" { match if binary-to-ascii (10, 8, "", suffix( option agent.circuit-id, 1)) = "22" and binary-to-ascii(10, 8, ".", packet(24, 4)) = "10.0.0.101"; } # собственно выдаем IP классу pool { range 10.20.0.22; allow members of "port22"; } } } cat /var/log/messages Sep 7 13:52:43 Server dhcpd: - Lease: 10.0.0.11 via IP: 0.0.0.0 (MAC: 30:30:2d:31:45:2d) on port: 22 in VLAN: 2 Sep 7 13:52:43 Server dhcpd: DHCPREQUEST for 10.0.0.11 from 1c:af:f7:37:8e:4f (DIR-300) via eth1.2 Sep 7 13:52:43 Server dhcpd: DHCPACK on 10.0.0.11 to 1c:af:f7:37:8e:4f (DIR-300) via eth1.2 Т.е. как видно из лога, влан с портом определяется нормально, но почему тогда ip выдается из левого пула, где накосячино? Полный лог: Sep 7 13:45:55 Server dhcpd: DHCPACK on 10.0.0.11 to 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 Sep 7 13:46:45 Server dhcpd: - Lease: 10.0.0.13 via IP: 10.0.0.101 (MAC: 30:30:2d:31:45:2d) on port: 22 in VLAN: 2 Sep 7 13:46:45 Server dhcpd: DHCPDISCOVER from f0:7d:68:5b:8c:67 via 10.0.0.101 Sep 7 13:46:46 Server dhcpd: DHCPOFFER on 10.0.0.13 to f0:7d:68:5b:8c:67 (DIR-300) via 10.0.0.101 Sep 7 13:46:46 Server dhcpd: - Lease: 10.0.0.13 via IP: 10.0.0.101 (MAC: 30:30:2d:31:45:2d) on port: 22 in VLAN: 2 Sep 7 13:46:46 Server dhcpd: DHCPREQUEST for 10.0.0.13 (10.0.0.1) from f0:7d:68:5b:8c:67 (DIR-300) via 10.0.0.101 Вставить ник Quote
terrible Posted September 7, 2011 Posted September 7, 2011 Почистите лизы, ребутрите демона. По идее должно всё нормально заработать. Вставить ник Quote
ga6iem Posted September 8, 2011 Author Posted September 8, 2011 Почистите лизы, ребутрите демона. По идее должно всё нормально заработать. [root@Server ~]# killall /usr/local/sbin/dhcpd [root@Server ~]# > /var/db/dhcpd.leases [root@Server ~]# /usr/local/sbin/dhcpd Internet Systems Consortium DHCP Server 4.2.1-P1 Copyright 2004-2011 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ Wrote 0 class decls to leases file. Wrote 0 leases to leases file. Multiple interfaces match the same shared network: eth1 eth1.2 Listening on LPF/vmnet3/00:50:56:c0:00:03/172.16.244.0/24 Sending on LPF/vmnet3/00:50:56:c0:00:03/172.16.244.0/24 Listening on LPF/eth1.4/00:e0:4c:c2:0a:28/10.40.0.0/24 Sending on LPF/eth1.4/00:e0:4c:c2:0a:28/10.40.0.0/24 Listening on LPF/eth1.3/00:e0:4c:c2:0a:28/10.30.0.0/24 Sending on LPF/eth1.3/00:e0:4c:c2:0a:28/10.30.0.0/24 Listening on LPF/eth1.2/00:e0:4c:c2:0a:28/dlink Sending on LPF/eth1.2/00:e0:4c:c2:0a:28/dlink Listening on LPF/eth1/00:e0:4c:c2:0a:28/dlink Sending on LPF/eth1/00:e0:4c:c2:0a:28/dlink Listening on LPF/eth0/00:14:2a:66:59:1b/192.168.26.0/24 Sending on LPF/eth0/00:14:2a:66:59:1b/192.168.26.0/24 Sending on Socket/fallback/fallback-net [root@Server ~]# tail -f /var/log/messages Sep 8 10:15:47 Server dhcpd: DHCPDISCOVER from 1c:af:f7:37:8e:4f via 10.0.0.101 Sep 8 10:15:48 Server dhcpd: DHCPOFFER on 10.0.0.2 to 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 Sep 8 10:15:48 Server dhcpd: - Lease: 10.0.0.2 via IP: 10.0.0.101 (MAC: 00:1e:58:6f:3:40) on port: 22 in VLAN: 2 Sep 8 10:15:48 Server dhcpd: DHCPDISCOVER from 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 Sep 8 10:15:48 Server dhcpd: DHCPOFFER on 10.0.0.2 to 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 чето нифига не пашет =( Вставить ник Quote
terrible Posted September 8, 2011 Posted September 8, 2011 а если подсеть 10.0.0.0 удалить, что работать будет? Вставить ник Quote
3gvanek Posted September 9, 2011 Posted September 9, 2011 а если подсеть 10.0.0.0 удалить, что работать будет? Ничего не будет работать. Я так понимаю что на сервере 10.0.0.1 ? Нужно делать просто subnet 10.0.0.0 netmask 255.255.255.0 {} и не описывать ничего внутри. Вставить ник Quote
ga6iem Posted September 9, 2011 Author Posted September 9, 2011 (edited) хмм, так shared-network dlink { subnet 10.0.0.0 netmask 255.255.255.0 { # range 10.0.0.2 10.0.0.90; # option broadcast-address 10.0.0.255; # option subnet-mask 255.255.255.0; # option domain-name-servers 10.0.0.1,8.8.8.8; # option routers 10.0.0.1; } subnet 10.20.0.0 netmask 255.255.255.0 { option broadcast-address 10.20.0.255; option subnet-mask 255.255.255.0; option domain-name-servers 10.20.0.1,8.8.8.8; option routers 10.20.0.1; class "port22" { match if binary-to-ascii (10, 8, "", suffix( option agent.circuit-id, 1)) = "22" and binary-to-ascii(10, 8, ".", packet(24, 4)) = "10.0.0.101"; } # собственно выдаем IP классу pool { range 10.20.0.22; allow members of "port22"; } } работает. Sep 9 11:57:17 Server dhcpd: - Lease: 10.20.0.22 via IP: 10.0.0.101 (MAC: 00:1e:58:6f:3:40) on port: 22 in VLAN: 2 Sep 9 11:57:17 Server dhcpd: DHCPDISCOVER from 1c:af:f7:37:8e:4f via 10.0.0.101 Sep 9 11:57:18 Server dhcpd: DHCPOFFER on 10.20.0.22 to 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 Sep 9 11:57:18 Server dhcpd: - Lease: 10.20.0.22 via IP: 10.0.0.101 (MAC: 00:1e:58:6f:3:40) on port: 22 in VLAN: 2 Sep 9 11:57:18 Server dhcpd: DHCPREQUEST for 10.20.0.22 (10.0.0.1) from 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 Sep 9 11:57:18 Server dhcpd: DHCPACK on 10.20.0.22 to 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 А почему?, не понятна логика работы dhcpd.. Причем здесь subnet 10.0.0.0/24 и как для нее теперь выдавать аренду? Теперь в логе Sep 9 11:59:00 Server dhcpd: DHCPREQUEST for 10.0.0.22 from 00:0a:e4:33:3c:97 via eth1: unknown lease 10.0.0.22. Sep 9 11:59:13 Server last message repeated 2 times Sep 9 12:00:03 Server dhcpd: DHCPREQUEST for 10.0.0.22 from 00:0a:e4:33:3c:97 via 10.0.0.101: unknown lease 10.0.0.22. и сразу Sep 7 12:15:38 Server dhcpd: lease 10.20.0.29: no subnet. Sep 9 12:04:01 Server dhcpd: - Lease: 10.20.0.29 via IP: 10.0.0.101 (MAC: 00:1e:58:6f:3:40) on port: 28 in VLAN: 1 Sep 9 12:04:02 Server dhcpd: DHCPOFFER on 10.20.0.29 to 00:0a:e4:33:3c:97 (artyom) via 10.0.0.101 Sep 9 12:04:02 Server dhcpd: - Lease: 10.20.0.29 via IP: 10.0.0.101 (MAC: 00:1e:58:6f:3:40) on port: 28 in VLAN: 1 Sep 9 12:04:02 Server dhcpd: DHCPREQUEST for 10.20.0.29 (10.0.0.1) from 00:0a:e4:33:3c:97 (artyom) via 10.0.0.101 Sep 9 12:04:02 Server dhcpd: DHCPACK on 10.20.0.29 to 00:0a:e4:33:3c:97 (artyom) via 10.0.0.101 т.е. как видно начинает выдавать в subnet1 адреса из subnet2 (10.20.0.0/24). Почему? Основываясь на ip коммутатора 10.0.0.101? Тогда почему не учитывает № порта? Edited September 9, 2011 by ga6iem Вставить ник Quote
3gvanek Posted September 9, 2011 Posted September 9, 2011 (edited) Я в конфиге не вижу ни 28 порта, ни вланов. Subnet 10.0.0.0/24 нужен для старта dhcpd и приема discover и request от релай агентов из этой же подсети. И если в ней менеджмент свичей, то идея выдавать туда адреса не очень удачная. Набросайте схему. Что куда включено и в какой влан. Edited September 9, 2011 by 3gvanek Вставить ник Quote
ga6iem Posted September 9, 2011 Author Posted September 9, 2011 (edited) Да примитив. Стенд: DES-3200-28:5#sh vlan Command: show vlan VID : 1 VLAN Name : default VLAN Type : Static Advertisement : Enabled Member Ports : 1-21,23-28 Static Ports : 1-21,23-28 Current Tagged Ports : Current Untagged Ports : 1-21,23-28 Static Tagged Ports : Static Untagged Ports : 1-21,23-28 Forbidden Ports : VID : 2 VLAN Name : v2 VLAN Type : Static Advertisement : Disabled Member Ports : 1,22 Static Ports : 1,22 Current Tagged Ports : 1 Current Untagged Ports : 22 Static Tagged Ports : 1 Static Untagged Ports : 22 Forbidden Ports : Total Entries : 2 В первый порт соответственно воткнут DHCP. 1-21,23-28 порты vlan1 (10.0.0.0/24) Задача в 22 порт (vlan2) выдать 10.20.0.22/24 Edited September 9, 2011 by ga6iem Вставить ник Quote
terrible Posted September 9, 2011 Posted September 9, 2011 Я в конфиге не вижу ни 28 порта, ни вланов. Автор просто опознаёт клиента по IP адресу релея, и кладёт на вланы. А 28 порт - это неправильно настроенные релей. Попробуйте настроить вот так: DHCP Relay Agent Information Option 82 State : Enabled DHCP Relay Agent Information Option 82 Check : Disabled DHCP Relay Agent Information Option 82 Policy : Keep Вставить ник Quote
3gvanek Posted September 9, 2011 Posted September 9, 2011 Вообще имхо лучше пользовать relay на l3, а на доступе только подсовывать option 82. Вставить ник Quote
ga6iem Posted September 9, 2011 Author Posted September 9, 2011 (edited) DES-3200-28 DES-3200-28:5#show dhcp_relay Command: show dhcp_relay DHCP/BOOTP Relay Status : Enabled DHCP/BOOTP Hops Count Limit : 4 DHCP/BOOTP Relay Time Threshold : 0 DHCP Relay Agent Information Option 82 State : Enabled DHCP Relay Agent Information Option 82 Check : Disabled DHCP Relay Agent Information Option 82 Policy : Keep DHCP Relay Agent Information Option 82 Remote ID : 00-1E-58-6F-03-40 Interface Server 1 Server 2 Server 3 Server 4 ------------ --------------- --------------- --------------- -------------- System 10.0.0.1 DES-3200-28:5#sh vlan Command: show vlan VID : 1 VLAN Name : default VLAN Type : Static Advertisement : Enabled Member Ports : 1-21,23-28 Static Ports : 1-21,23-28 Current Tagged Ports : Current Untagged Ports : 1-21,23-28 Static Tagged Ports : Static Untagged Ports : 1-21,23-28 Forbidden Ports : VID : 2 VLAN Name : v2 VLAN Type : Static Advertisement : Disabled Member Ports : 1,22 Static Ports : 1,22 Current Tagged Ports : 1 Current Untagged Ports : 22 Static Tagged Ports : 1 Static Untagged Ports : 22 Forbidden Ports : Total Entries : 2 если dhcpd.conf shared-network dlink { subnet 10.0.0.0 netmask 255.255.255.0 { range 10.0.0.2 10.0.0.90; option broadcast-address 10.0.0.255; option subnet-mask 255.255.255.0; option domain-name-servers 10.0.0.1,8.8.8.8; option routers 10.0.0.1; } subnet 10.20.0.0 netmask 255.255.255.0 { option broadcast-address 10.20.0.255; option subnet-mask 255.255.255.0; option domain-name-servers 10.20.0.1,8.8.8.8; option routers 10.20.0.1; class "port22" { match if binary-to-ascii (10, 8, "", suffix( option agent.circuit-id, 1)) = "22" and binary-to-ascii(10, 8, ".", packet(24, 4)) = "10.0.0.101"; # and binary-to-ascii(10, 16, "", substring(option agent.circuit-id, 2, 2)) = "2"; } # собственно выдаем IP классу pool { range 10.20.0.22; allow members of "port22"; } } то Sep 9 14:10:10 Server dhcpd: - Lease: 10.0.0.2 via IP: 10.0.0.101 (MAC: 00:1e:58:6f:3:40) on port: 22 in VLAN: 2 Sep 9 14:10:10 Server dhcpd: DHCPDISCOVER from 1c:af:f7:37:8e:4f via 10.0.0.101 Sep 9 14:10:11 Server dhcpd: DHCPOFFER on 10.0.0.2 to 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 Sep 9 14:10:11 Server dhcpd: - Lease: 10.0.0.2 via IP: 10.0.0.101 (MAC: 00:1e:58:6f:3:40) on port: 22 in VLAN: 2 Sep 9 14:10:11 Server dhcpd: DHCPREQUEST for 10.0.0.2 (10.0.0.1) from 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 Sep 9 14:10:11 Server dhcpd: DHCPACK on 10.0.0.2 to 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 т.е. не работает. Если так: shared-network dlink { subnet 10.0.0.0 netmask 255.255.255.0 { } subnet 10.20.0.0 netmask 255.255.255.0 { option broadcast-address 10.20.0.255; option subnet-mask 255.255.255.0; option domain-name-servers 10.20.0.1,8.8.8.8; option routers 10.20.0.1; class "port22" { match if binary-to-ascii (10, 8, "", suffix( option agent.circuit-id, 1)) = "22" and binary-to-ascii(10, 8, ".", packet(24, 4)) = "10.0.0.101"; # and binary-to-ascii(10, 16, "", substring(option agent.circuit-id, 2, 2)) = "2"; } # собственно выдаем IP классу pool { range 10.20.0.22; allow members of "port22"; } } то Sep 9 14:28:26 Server dhcpd: - Lease: 10.20.0.22 via IP: 10.0.0.101 (MAC: 00:1e:58:6f:3:40) on port: 22 in VLAN: 2 Sep 9 14:28:26 Server dhcpd: DHCPDISCOVER from 1c:af:f7:37:8e:4f via 10.0.0.101 Sep 9 14:28:27 Server dhcpd: DHCPOFFER on 10.20.0.22 to 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 Sep 9 14:28:27 Server dhcpd: - Lease: 10.20.0.22 via IP: 10.0.0.101 (MAC: 00:1e:58:6f:3:40) on port: 22 in VLAN: 2 Sep 9 14:28:27 Server dhcpd: DHCPREQUEST for 10.20.0.22 (10.0.0.1) from 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 Sep 9 14:28:27 Server dhcpd: DHCPACK on 10.20.0.22 to 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 работает, т.е. отдает 10.20.0.22 в 22 порт, но так же отдает всем остальным портам сабнет 10.20.0.0/24 Sep 9 14:47:15 Server dhcpd: - Lease: 10.20.0.29 via IP: 10.0.0.101 (MAC: 00:1e:58:6f:3:40) on port: 28 in VLAN: 1 Sep 9 14:47:15 Server dhcpd: DHCPDISCOVER from 00:0a:e4:33:3c:97 via 10.0.0.101 Sep 9 14:47:16 Server dhcpd: DHCPOFFER on 10.20.0.29 to 00:0a:e4:33:3c:97 (artyom) via 10.0.0.101 Sep 9 14:47:16 Server dhcpd: - Lease: 10.20.0.29 via IP: 10.0.0.101 (MAC: 00:1e:58:6f:3:40) on port: 28 in VLAN: 1 Sep 9 14:47:16 Server dhcpd: DHCPREQUEST for 10.20.0.29 (10.0.0.1) from 00:0a:e4:33:3c:97 (artyom) via 10.0.0.101 Sep 9 14:47:16 Server dhcpd: DHCPACK on 10.20.0.29 to 00:0a:e4:33:3c:97 (artyom) via 10.0.0.101 пс: 10.20.0.29 - это мой ноут на 28 порте в первом vlan Edited September 9, 2011 by ga6iem Вставить ник Quote
alexxx71 Posted September 9, 2011 Posted September 9, 2011 вынесите секции subnet из shared-network и будет вам счастье. Вставить ник Quote
ga6iem Posted September 9, 2011 Author Posted September 9, 2011 (edited) Разобрался. Оказывается от перемены мест слагаемых сумма всет-ки меняется.. Надо так: shared-network dlink { subnet 10.20.0.0 netmask 255.255.255.0 { option broadcast-address 10.20.0.255; option subnet-mask 255.255.255.0; option domain-name-servers 10.20.0.1,8.8.8.8; option routers 10.20.0.1; class "port22" { match if binary-to-ascii (10, 8, "", suffix( option agent.circuit-id, 1)) = "22" and binary-to-ascii(10, 8, ".", packet(24, 4)) = "10.0.0.101"; # and binary-to-ascii(10, 16, "", substring(option agent.circuit-id, 2, 2)) = "2"; } # собственно выдаем IP классу pool { range 10.20.0.22; allow members of "port22"; } subnet 10.0.0.0 netmask 255.255.255.0 { range 10.0.0.2 10.0.0.90; option broadcast-address 10.0.0.255; option subnet-mask 255.255.255.0; option domain-name-servers 10.0.0.1,8.8.8.8; option routers 10.0.0.1; } } Все щастливы: Sep 9 14:58:31 Server dhcpd: - Lease: 10.20.0.22 via IP: 10.0.0.101 (MAC: 00:1e:58:6f:3:40) on port: 22 in VLAN: 2 Sep 9 14:58:31 Server dhcpd: DHCPDISCOVER from 1c:af:f7:37:8e:4f via 10.0.0.101 Sep 9 14:58:32 Server dhcpd: DHCPOFFER on 10.20.0.22 to 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 Sep 9 14:58:32 Server dhcpd: - Lease: 10.20.0.22 via IP: 10.0.0.101 (MAC: 00:1e:58:6f:3:40) on port: 22 in VLAN: 2 Sep 9 14:58:32 Server dhcpd: DHCPREQUEST for 10.20.0.22 (10.0.0.1) from 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 Sep 9 14:58:32 Server dhcpd: DHCPACK on 10.20.0.22 to 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 Sep 9 14:58:47 Server dhcpd: - Lease: 10.0.0.22 via IP: 10.0.0.101 (MAC: 00:1e:58:6f:3:40) on port: 28 in VLAN: 1 Sep 9 14:58:47 Server dhcpd: DHCPDISCOVER from 00:0a:e4:33:3c:97 via 10.0.0.101 Sep 9 14:58:48 Server dhcpd: DHCPOFFER on 10.0.0.22 to 00:0a:e4:33:3c:97 (artyom) via 10.0.0.101 Sep 9 14:58:48 Server dhcpd: - Lease: 10.0.0.22 via IP: 10.0.0.101 (MAC: 00:1e:58:6f:3:40) on port: 28 in VLAN: 1 Sep 9 14:58:48 Server dhcpd: DHCPREQUEST for 10.0.0.22 (10.0.0.1) from 00:0a:e4:33:3c:97 (artyom) via 10.0.0.101 Sep 9 14:58:48 Server dhcpd: DHCPACK on 10.0.0.22 to 00:0a:e4:33:3c:97 (artyom) via 10.0.0.101 Edited September 9, 2011 by ga6iem Вставить ник Quote
h1vs2 Posted October 19, 2011 Posted October 19, 2011 (edited) Дабы не плодить темы спрошу тут : Почти та же ситуация, что и у топикстартера, только использую dhcp_local_relay Есть подсеть белых, выдается каждому юзеру на основе опции82 и есть подсеть серых, для unknown-clients. Для серых поставил маленький lease-time. Все хорошо, только когда клиент получил серый, он уже потом не получает белый(когда проходит время лизы, или если вручную жмешь обновить), вернее получает, но только то, что указано в option subnet-mask, option domain-name-servers, option routers. IP остается из серой подсети. Даже если сделать > /var/db/dhcpd/dhcpd.leases и после рестартануть dhcp. Если же отключить сетевую(клиентскую), сделать > /var/db/dhcpd/dhcpd.leases и рестартануть dhcp - все хорошо. Что странно : в обратном порядке(с белых на серые) без проблем. Как победить? Спасибо! Edited October 20, 2011 by h1vs2 Вставить ник Quote
s.lobanov Posted October 19, 2011 Posted October 19, 2011 h1vs2 Интересная проблема. Покажите версию dhcpd и существенную часть конфига Вставить ник Quote
h1vs2 Posted October 20, 2011 Posted October 20, 2011 (edited) h1vs2 Интересная проблема. Покажите версию dhcpd и существенную часть конфига # dhcpd.conf # # Sample configuration file for ISC dhcpd # # option definitions common to all supported networks... #option domain-name "blabla"; ddns-update-style interim; #default-lease-time 600; #max-lease-time 7200; #local-address xxx.xxx.xx.253; log-facility local7; #deny duplicates; #authoritative; #allow unknown-clients; if exists agent.remote-id and exists agent.circuit-id { if binary-to-ascii(16, 8, "", substring(option agent.remote-id, 2, 1)) = "0" { set switch-mac = concat("0", binary-to-ascii(16, 8, "", substring(option agent.remote-id, 2, 1)), ":", binary-to-ascii(16, 8, ":", substring(option agent.remote-id, 3, 6))); } else { set switch-mac = binary-to-ascii(16, 8, ":", substring(option agent.remote-id, 2, 6)); } set switch-addr = binary-to-ascii(10, 8, ".", packet(24, 4)); set switch-port = binary-to-ascii(10, 8, "", substring(option agent.circuit-id, 5, 1)); set switch-port-vlan = binary-to-ascii(10, 16, "", substring(option agent.circuit-id, 2, 2)); log (info, concat("- Lease: ", binary-to-ascii(10, 8, ".", leased-address), " via IP: ", switch-addr, " (MAC: ", switch-mac, ") on port: ", switch-port, " in VLAN: ", switch-port-vlan)); } shared-network hhhhhh { ###zzzzzz_subnet### subnet xxx.xxx.xx.0 netmask 255.255.252.0 { default-lease-time 600; max-lease-time 7200; option subnet-mask 255.255.252.0; option domain-name-servers yy.yyy.35.253, yy.yyy.33.131; option routers xxx.xxx.xx.250; class "client1" { match if ( binary-to-ascii(10, 16, "", substring(option agent.circuit-id, 4, 2)) = "3" #PORT and substring(option agent.remote-id, 2, 15) = "10.10.0.1" #Switch remote_ID_sting ); } pool { range xxx.xxx.xx.2; allow members of "client1"; } class "client2" { match if ( binary-to-ascii(10, 16, "", substring(option agent.circuit-id, 4, 2)) = "1" #PORT and substring(option agent.remote-id, 2, 15) = "10.10.0.1" #Switch remote_ID_sting ); } pool { range xxx.xxx.xx.1; allow members of "client2"; } } ###UNKNOWN_USERS_subnet### subnet 172.16.16.0 netmask 255.255.255.0 { #range 172.16.16.5 172.16.16.249; default-lease-time 60; max-lease-time 100; #option subnet-mask 255.255.255.0; option domain-name-servers 172.16.16.253; option routers 172.16.16.250; #allow unknown-clients; pool { range 172.16.16.6 172.16.16.248; allow unknown-clients; } } ########################## } isc-dhcpd-4.1.2-P1 Сегодня столкнулся ещё с одной проблемой : Включаешь клиентский ноутбук, все хорошо - получаешь IP. Но основе порта и свитча. Вынимаешь, вставляешь в другой ноутбук : ничего не получаешь - no free lease. Очищаешь все лизы, рестартишь демон - получаешь. Разве это нормально ? Запросы релеит циска, её исключил, подключил напрямую - ситуация та же. Поставил isc-dhcpd-V3.1-ESV - ничего не изменилось... Edited October 21, 2011 by h1vs2 Вставить ник Quote
ixi Posted October 21, 2011 Posted October 21, 2011 Включаешь клиентский ноутбук, все хорошо - получаешь IP. Но основе порта и свитча. Вынимаешь, вставляешь в другой ноутбук : ничего не получаешь - no free lease. Очищаешь все лизы, рестартишь демон - получаешь. Разве это нормально ? Адрес уже зарезервирован за маком старого ноутбука. Пока срок не истечёт, никто его не получит. По поводу (не)смены адресов -- а не клиент ли виноват? Вставить ник Quote
h1vs2 Posted October 21, 2011 Posted October 21, 2011 (edited) Включаешь клиентский ноутбук, все хорошо - получаешь IP. Но основе порта и свитча. Вынимаешь, вставляешь в другой ноутбук : ничего не получаешь - no free lease. Очищаешь все лизы, рестартишь демон - получаешь. Разве это нормально ? Адрес уже зарезервирован за маком старого ноутбука. Пока срок не истечёт, никто его не получит. По поводу (не)смены адресов -- а не клиент ли виноват? А нет ли опции, чтобы лиза удалялась ? Как решают эту проблему ? Нет, тестилось на разных клиентах. UPDATE: Нашел опцию one-lease-per-client. Думаю поможет в вопросе с лизами. В понедельник проверю. А вот проблема со сменой серых на белые для меня вовсе не понятна. Edited October 21, 2011 by h1vs2 Вставить ник Quote
Negator Posted October 22, 2011 Posted October 22, 2011 А нет ли опции, чтобы лиза удалялась ? Как решают эту проблему ? Есть патч для isc-dhcpd ищите на форуме Вставить ник Quote
h1vs2 Posted October 24, 2011 Posted October 24, 2011 А нет ли опции, чтобы лиза удалялась ? Как решают эту проблему ? Есть патч для isc-dhcpd ищите на форуме Вы не могли бы ткнуть носом, не могу найти. Вставить ник Quote
h1vs2 Posted October 27, 2011 Posted October 27, 2011 По поводу второй проблемы все решилось. Помог патчик от dd. Вот тут подробней. А насчет проблемы "серых-белых" - тупик. Есть у кого-то какие-то идеи? Вставить ник Quote
xcme Posted November 20, 2011 Posted November 20, 2011 Кто-нибудь использует spawning class + opt 82? Вот тут (http://dharmaroute.ru/2010/08/27/isc-dhcpd-server-configuration-hints/ ) пишут "Тут появляется небольшая загвоздка, так как по-умолчанию ISC-DHCPD под FreeBSD не может использовать subclass в операции pool" (isc-dhcp31-server-3.1.3_1), однако в мане к 4-му об этом ничего не сказано. И еще вопрос, если запрос попадает сразу под оба класса то проверка идет до первого совпадения, последнего или абонент окажется в обоих классах? Например есть "класс 1" для свича 192.168.0.1 и порта 1 и "класс 2" для свича 192.168.0.1, порта 1 и мака 00:11:22:33:44:55. Соответственно пул 1 для класса 1 и пул 2 для класса 2. Из какого пула получит ip клиент с маком 00:11:22:33:44:55 с первого порта коммутатора? Вставить ник Quote
s.lobanov Posted November 20, 2011 Posted November 20, 2011 xcme Собрать стенд и проверить - делов на часов, это надёжнее, чем гадать как оно работает. Вставить ник Quote
Ivan_83 Posted November 21, 2011 Posted November 21, 2011 Забудьте вы уже про ISC-DHCPD, это тоже самое что с виндовым дхцп возится: для стандартных ситуаций хорошо, для особенных случаев не применимо. Вставить ник Quote
Cramac Posted December 11, 2011 Posted December 11, 2011 А никто не подскажет, можно ли в ISC-DHCPD в конфиге подключать директорию с конфигами? т.е. хочу из конфига вынести в отдельные файлы настройки опции 82 для каждого свитча Вставить ник Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.