|
From: Andy Rabagliati on 24 Dec 2006 08:25 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"; }
From: Martijn Lievaart on 25 Dec 2006 18:48 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.
|
Pages: 1 Prev: using Perl to find string.. Next: Use of Java script to validate form fields in Perl |