DHCP server

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::DHCP::packet->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";
}
 
M

Martijn Lievaart

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.

Start wireshark (formerly ethereal) and look at the differences from a
working DHCP server and yours.

HTH,
M4
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top