>[оверквотинг удален]
>>> ВНУТРЬ шаред нетворк...
>> Да, помогло.
>> Еще такой вопрос, есть bootp flags в дискаверах. В нем есть relay
>> agent ip address. На рутерах настроет хелпер адрес. Можно как-то матчить
>> по ip адресу с какого роутера пришел
>> дискавер? Сами роутеры, насколько я понимаю, инкапсулируют в пакет первый secondary ip
>> адрес.
> Нашел, если сделать
> log( info,concat("DEBUG BOOTP_IP ", binary-to-ascii(10, 8, ".", packet(24,4))));
> То можно увидеть ip адрес этого первого secondary адреса.Теперь новая проблема.
Вот логи
Dec 2 12:54:17 ipv6provisioning dhcpd: *DEBUG Vendor ID docsis
Dec 2 12:54:17 ipv6provisioning dhcpd: *DEBUG Vendor ID docs
Dec 2 12:54:17 ipv6provisioning dhcpd: DEBUG BOOTP_IP 10.105.0.1
Dec 2 12:54:17 ipv6provisioning dhcpd: *DEBUG Remote-ID: 0:11:e3:f1:a7:23
Dec 2 12:54:17 ipv6provisioning dhcpd: DHCPDISCOVER from 00:11:e3:f1:a7:23 via 10.105.0.1
Dec 2 12:54:18 ipv6provisioning dhcpd: DHCPOFFER on 10.105.0.2 to 00:11:e3:f1:a7:23 via 10.105.0.1
Dec 2 12:54:20 ipv6provisioning dhcpd: *DEBUG Vendor ID docsis
Dec 2 12:54:20 ipv6provisioning dhcpd: *DEBUG Vendor ID docs
Dec 2 12:54:20 ipv6provisioning dhcpd: DEBUG BOOTP_IP 10.105.0.1
Dec 2 12:54:20 ipv6provisioning dhcpd: *DEBUG Remote-ID: 0:11:e3:f1:a7:23
Dec 2 12:54:20 ipv6provisioning dhcpd: execute_statement argv[0] = /dhcp_scripts/dbleases.php
Dec 2 12:54:20 ipv6provisioning dhcpd: execute_statement argv[1] = '1'
Dec 2 12:54:20 ipv6provisioning dhcpd: execute_statement argv[2] = '10.105.0.2'
Dec 2 12:54:20 ipv6provisioning dhcpd: execute_statement argv[3] = '0011e3f1a723'
Dec 2 12:54:20 ipv6provisioning dhcpd: DHCPREQUEST for 10.105.0.2 (192.168.183.30) from 00:11:e3:f1:a7:23 via 10.105.0.1
Dec 2 12:54:20 ipv6provisioning dhcpd: DHCPACK on 10.105.0.2 to 00:11:e3:f1:a7:23 via 10.105.0.1
Dec 2 12:54:31 ipv6provisioning dhcpd: DHCPDISCOVER from 00:11:e3:f1:a7:24 via 10.110.0.1: network mta: no free leases
Проблема в том, что не получается раздать адреса из сети 10.110.0.0/24.
Конфиг для этой сети такой же как для 10.105.0.0/24, которая успешно раздается.
Сам конфиг выглядет так:
INTERFACES="eth1";
log-facility local7;
omapi-port 7911;
omapi-key omapi_key;
key omapi_key {
algorithm hmac-md5;
secret f501a3c9cc7ccf2318d319390a9f09be;
}
ddns-update-style interim;
authoritative;
allow bootp;
deny declines;
default-lease-time 86400;
max-lease-time 86400;
option time-servers 192.168.183.30;
option space docsis-mta;
option docsis-mta.dhcp-server-1 code 1 = ip-address;
option docsis-mta.dhcp-server-2 code 2 = ip-address;
option docsis-mta.provision-server code 3 = { integer 8, string };
option docsis-mta.krb-realm-name code 6 = string;
option docsis-mta.timer code 7 = string;
option docsis-mta-pkt code 122 = encapsulate docsis-mta;
option space PC-MTA;
option PC-MTA.DHCP-server-1 code 1 = ip-address;
option PC-MTA.DHCP-server-2 code 2 = ip-address;
option PC-MTA.Provision-server code 3 = {integer 8, string };
option PC-MTA.AS-REQ_AS-REP code 4 = { integer 32, integer 32, integer 32 };
option PC-MTA.AP-REQ_AP-REP code 5 = { integer 32, integer 32, integer 32 };
option PC-MTA.Kerberos-realm code 6 = string;
option PC-MTA.TGS-util code 7 = integer 8;
option PC-MTA.Provision-timer code 8 = integer 8;
option PC-MTA.Ticket-ctrl-mask code 9 = integer 16;
option PC-MTA-122 code 122 = encapsulate PC-MTA;
option space packetcable;
option packetcable.primary-dhcp-server code 1 = ip-address;
option packetcable.snmp-entity-address code 6 = string;
option packetcable.kerberos-realm-name code 6 = string;
option packetcable.primary-dhcp-server 192.168.183.30;
log( info,concat("*DEBUG Vendor ID ",substring(option vendor-class-identifier,0,6)));
log( info,concat("*DEBUG Vendor ID ",substring(option vendor-class-identifier,0,4)));
log( info,concat("DEBUG BOOTP_IP ", binary-to-ascii(10, 8, ".", packet(24,4))));
log( info,concat("*DEBUG Remote-ID: ",binary-to-ascii(16,8,":",option agent.remote-id)) );
on commit {
set oper=concat("'1","'");
set clip = concat("'",binary-to-ascii(10, 8, ".", leased-address),"'");
set clhw = concat ("'",suffix (concat ("0", binary-to-ascii (16, 8, "", substring (hardware, 1, 1))),2), "", suffix (concat ("0", binary-to-ascii (16, 8, "", substring (hardware, 2, 1))),2), "",suffix (concat ("0", binary-to-ascii (16, 8, "", substring (hardware, 3, 1))),2), "", suffix (concat ("0", binary-to-ascii (16, 8, "", substring (hardware, 4, 1))),2), "", suffix (concat ("0", binary-to-ascii (16, 8, "", substring (hardware, 5, 1))),2), "", suffix (concat ("0", binary-to-ascii (16, 8, "", substring (hardware, 6, 1))),2),"'");
execute("/dhcp_scripts/dbleases.php", oper, clip, clhw);
}
on release {
set clip = binary-to-ascii(10, 8, ".", leased-address);
set clhw = concat (suffix (concat ("0", binary-to-ascii (16, 8, "", substring (hardware, 1, 1))),2), "", suffix (concat ("0", binary-to-ascii (16, 8, "", substring (hardware, 2, 1))),2), "",suffix (concat ("0", binary-to-ascii (16, 8, "", substring (hardware, 3, 1))),2), "", suffix (concat ("0", binary-to-ascii (16, 8, "", substring (hardware, 4, 1))),2), "", suffix (concat ("0", binary-to-ascii (16, 8, "", substring (hardware, 5, 1))),2), "", suffix (concat ("0", binary-to-ascii (16, 8, "", substring (hardware, 6, 1))),2));
execute("/dhcp_scripts/dbleases.php", 2, clip, clhw);
}
on expiry {
set clip = binary-to-ascii(10, 8, ".", leased-address);
set clhw = concat (suffix (concat ("0", binary-to-ascii (16, 8, "", substring (hardware, 1, 1))),2), "", suffix (concat ("0", binary-to-ascii (16, 8, "", substring (hardware, 2, 1))),2), "",suffix (concat ("0", binary-to-ascii (16, 8, "", substring (hardware, 3, 1))),2), "", suffix (concat ("0", binary-to-ascii (16, 8, "", substring (hardware, 4, 1))),2), "", suffix (concat ("0", binary-to-ascii (16, 8, "", substring (hardware, 5, 1))),2), "", suffix (concat ("0", binary-to-ascii (16, 8, "", substring (hardware, 6, 1))),2));
execute("/dhcp_scripts/dbleases.php", 3, clip, clhw);
}
class "c41mta" {
match if
(substring (option vendor-class-identifier,0,4) = "pkts") and (binary-to-ascii(10, 8, ".", packet(24,4))="10.110.0.1");
}
class "c41cm" {
match if
(substring (option vendor-class-identifier,0,6) = "docsis") and (binary-to-ascii(10, 8, ".", packet(24,4))="10.105.0.1");
}
shared-network "docsis"{
subnet 192.168.183.0 netmask 255.255.255.0{}
# cmts1 cm
subnet 10.105.0.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
pool {
range 10.105.0.2 10.105.0.250;
option subnet-mask 255.255.255.0;
option routers 10.105.0.1;
option PC-MTA.DHCP-server-1 192.168.183.30;
option docsis-mta.dhcp-server-1 192.168.183.30;
next-server 192.168.183.30;
option time-servers 192.168.183.30;
option host-name = host-decl-name;
filename = concat (suffix (concat ("0", binary-to-ascii (16, 8, "", substring (hardware, 1, 1))),2), "", suffix (concat ("0", binary-to-ascii (16, 8, "", substring (hardware, 2, 1))),2), "",suffix (concat ("0", binary-to-ascii (16, 8, "", substring (hardware, 3, 1))),2), "", suffix (concat ("0", binary-to-ascii (16, 8, "", substring (hardware, 4, 1))),2), "", suffix (concat ("0", binary-to-ascii (16, 8, "", substring (hardware, 5, 1))),2), "", suffix (concat ("0", binary-to-ascii (16, 8, "", substring (hardware, 6, 1))),2),".cm");
allow members of "c41cm";
}}
}
shared-network "mta"{
subnet 10.110.0.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
option routers 10.110.0.1;
option time-servers 192.168.183.30;
next-server 192.168.183.30;
allow unknown-clients;
pool {
range 10.110.0.2 10.110.0.250;
option subnet-mask 255.255.255.0;
option routers 10.110.0.1;
option PC-MTA.DHCP-server-1 192.168.183.30;
option docsis-mta.dhcp-server-1 192.168.183.30;
next-server 192.168.183.30;
option time-servers 192.168.183.30;
option host-name = host-decl-name;
filename = concat (suffix (concat ("0", binary-to-ascii (16, 8, "", substring (hardware, 1, 1))),2), "", suffix (concat ("0", binary-to-ascii (16, 8, "", substring (hardware, 2, 1))),2), "",suffix (concat ("0", binary-to-ascii (16, 8, "", substring (hardware, 3, 1))),2), "", suffix (concat ("0", binary-to-ascii (16, 8, "", substring (hardware, 4, 1))),2), "", suffix (concat ("0", binary-to-ascii (16, 8, "", substring (hardware, 5, 1))),2), "", suffix (concat ("0", binary-to-ascii (16, 8, "", substring (hardware, 6, 1))),2),".cm");
allow members of "c41mta";
}}
}
Если убрать allow members of "c41mta"; из пула в shared-network "mta", тогда все хорошо,
но мне необходимо строго матчить, что это вендор pkts и запрос пришел с 10.110.0.1.
Так и происходит, вот лог без allow members of "c41mta";, я часть из 105.0.0/24 пропущу
Dec 2 12:58:56 ipv6provisioning dhcpd: *DEBUG Vendor ID pktc1.
Dec 2 12:58:56 ipv6provisioning dhcpd: *DEBUG Vendor ID pktc
Dec 2 12:58:56 ipv6provisioning dhcpd: DEBUG BOOTP_IP 10.110.0.1
Dec 2 12:58:56 ipv6provisioning dhcpd: *DEBUG Remote-ID: 0:11:e3:f1:a7:23
Dec 2 12:58:56 ipv6provisioning dhcpd: DHCPDISCOVER from 00:11:e3:f1:a7:24 via 10.110.0.1
Dec 2 12:58:57 ipv6provisioning dhcpd: data: host_decl_name: not available
Dec 2 12:58:57 ipv6provisioning dhcpd: DHCPOFFER on 10.110.0.2 to 00:11:e3:f1:a7:24 via 10.110.0.1
Dec 2 12:58:59 ipv6provisioning dhcpd: *DEBUG Vendor ID pktc1.
Dec 2 12:58:59 ipv6provisioning dhcpd: *DEBUG Vendor ID pktc
Dec 2 12:58:59 ipv6provisioning dhcpd: DEBUG BOOTP_IP 10.110.0.1
Dec 2 12:58:59 ipv6provisioning dhcpd: *DEBUG Remote-ID: 0:11:e3:f1:a7:23
Dec 2 12:58:59 ipv6provisioning dhcpd: execute_statement argv[0] = /dhcp_scripts/dbleases.php
Dec 2 12:58:59 ipv6provisioning dhcpd: execute_statement argv[1] = '1'
Dec 2 12:58:59 ipv6provisioning dhcpd: execute_statement argv[2] = '10.110.0.2'
Dec 2 12:58:59 ipv6provisioning dhcpd: execute_statement argv[3] = '0011e3f1a724'
Dec 2 12:58:59 ipv6provisioning dhcpd: DHCPREQUEST for 10.110.0.2 (192.168.183.30) from 00:11:e3:f1:a7:24 via 10.110.0.1
Dec 2 12:58:59 ipv6provisioning dhcpd: data: host_decl_name: not available
Dec 2 12:58:59 ipv6provisioning dhcpd: DHCPACK on 10.110.0.2 to 00:11:e3:f1:a7:24 via 10.110.0.1
Есть via 10.110.0.1, значит bootp адрес верный.
Почему, когда матчу в пулах класс c41mta дхцп говорит что нет лизов?
Заранее благодарю.