Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > DHCP server

Reply
Thread Tools

DHCP server

 
 
Andy Rabagliati
Guest
Posts: n/a
 
      12-24-2006
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";
}

 
Reply With Quote
 
 
 
 
Martijn Lievaart
Guest
Posts: n/a
 
      12-25-2006
On Sun, 24 Dec 2006 05:25:57 -0800, Andy Rabagliati wrote:

> 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
--
Redundancy is a great way to introduce more single points of failure.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Protecting from Rogue DHCP Server attacks - DHCP Snooping ynnadmai@gmail.com Cisco 0 06-05-2009 04:46 AM
Dhcp Relay Agent And Acl On Sw 3750, DHCP Relay Agent and ACL on Sw 3750 Vimokh Cisco 3 09-06-2006 02:16 AM
Wireless DHCP clients cannot obtain an IP address from the DHCP se =?Utf-8?B?SGVpbkQ=?= Wireless Networking 0 01-08-2006 03:41 PM
run > ipconfig > net stop dhcp then > net start dhcp Fayza Computer Support 3 05-12-2004 07:10 PM
if Active Directory no DHCP? or: Where ist my DHCP Ingo Hauf Computer Support 2 10-18-2003 02:25 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57