A
Andy Rabagliati
Folks,
I am trying to make http://unixgu.ru/tmp/ctf-dhcpd/test.pl work, as I
need a DHCP server that can pull the leases from LDAP.
The ldap patches to the ISC DHCP server also do not work for me,
but the schema seems way too complicated in that case also.
I have the LDAP lookups working, and sendAnswer (in the perl script)
says it is working, but my clients do not receive an answer.
The routine in question is sendAnswer below. I usually have a
firewall on this machine, but it is configured to accept any traffic
from the LAN.
A regular DHCP server works, and I have tried turning the firewall
off, without success.
Any ideas ?
Cheers, Andy!
sub sendAnswer {
my( $type, $xid, $mac, $ip, $hostname ) =
( $_[0], $_[1], $_[2], $_[3], $_[4] );
print "<sendAnswer> type=$type, xid=$xid, mac=$mac, ip=$ip,
hostname=$hostname\n";
return unless $type and $mac and $ip;
my $answer = Net:
HCP:
acket->new(
'Op' => 2,
'flags' => 0x8000,
'Xid' => $xid,
DHO_DHCP_MESSAGE_TYPE() => $type,
'Yiaddr' => $ip,
'Chaddr' => $mac
);
$answer->addOptionValue( DHO_HOST_NAME(), $hostname ) if
$hostname;
if( $type eq DHCPACK() ) {
$answer->addOptionValue(
DHO_DOMAIN_NAME_SERVERS(),
$Config{ 'dhcp' }{ 'dnsServer' }
) if $Config{ 'dhcp' }{ 'dnsServer' };
$answer->addOptionValue(
DHO_ROUTERS(),
$Config{ 'dhcp' }{ 'defaultRoute' }
) if $Config{ 'dhcp' }{ 'defaultRoute' };
}
$Sock->send( $answer->serialize() )
or &handleError( 'Can\'t send answer:', $! );
print "</sendAnswer>\n";
}
I am trying to make http://unixgu.ru/tmp/ctf-dhcpd/test.pl work, as I
need a DHCP server that can pull the leases from LDAP.
The ldap patches to the ISC DHCP server also do not work for me,
but the schema seems way too complicated in that case also.
I have the LDAP lookups working, and sendAnswer (in the perl script)
says it is working, but my clients do not receive an answer.
The routine in question is sendAnswer below. I usually have a
firewall on this machine, but it is configured to accept any traffic
from the LAN.
A regular DHCP server works, and I have tried turning the firewall
off, without success.
Any ideas ?
Cheers, Andy!
sub sendAnswer {
my( $type, $xid, $mac, $ip, $hostname ) =
( $_[0], $_[1], $_[2], $_[3], $_[4] );
print "<sendAnswer> type=$type, xid=$xid, mac=$mac, ip=$ip,
hostname=$hostname\n";
return unless $type and $mac and $ip;
my $answer = Net:
'Op' => 2,
'flags' => 0x8000,
'Xid' => $xid,
DHO_DHCP_MESSAGE_TYPE() => $type,
'Yiaddr' => $ip,
'Chaddr' => $mac
);
$answer->addOptionValue( DHO_HOST_NAME(), $hostname ) if
$hostname;
if( $type eq DHCPACK() ) {
$answer->addOptionValue(
DHO_DOMAIN_NAME_SERVERS(),
$Config{ 'dhcp' }{ 'dnsServer' }
) if $Config{ 'dhcp' }{ 'dnsServer' };
$answer->addOptionValue(
DHO_ROUTERS(),
$Config{ 'dhcp' }{ 'defaultRoute' }
) if $Config{ 'dhcp' }{ 'defaultRoute' };
}
$Sock->send( $answer->serialize() )
or &handleError( 'Can\'t send answer:', $! );
print "</sendAnswer>\n";
}