Need help with LEASEQUERY..continued

Jiri Popelka jpopelka at redhat.com
Mon May 24 15:37:14 UTC 2010


On 05/21/2010 06:25 PM, Pat Winn wrote:
> Matt,
> Good thought. Unfortunately, I've already gone there.
> As with your luck, I never got anything to respond to the
> Perl code either. Even found a few snippets wherein people
> claimed it worked for them and STILL...no response from
> dhcpd when I tried it.
>
>    
I have just tried the Net::DHCP::Packet (as Roger Murray pointed; thanks 
Roger)
http://search.cpan.org/~shadinger/Net-DHCP-0.66/
and it works for me (ISC dhcp-4.1.1).
I only needed to change the DHCPLEASEQUERY constant:
diff -up Net/DHCP/Constants.pm.orig Net/DHCP/Constants.pm
--- Net/DHCP/Constants.pm.orig    2006-07-12 12:25:15.000000000 +0200
+++ Net/DHCP/Constants.pm    2010-05-24 17:22:03.000000000 +0200
@@ -167,7 +167,7 @@ BEGIN {
      'DHCPINFORM'        => 8,
      'DHCPFORCERENEW'    => 9,

-    'DHCPLEASEQUERY'    => 13,   # Cisco extension, 
draft-ietf-dhc-leasequery-08.txt
+    'DHCPLEASEQUERY'    => 10,   # RFC 4388
      );
  }

I used the Net-DHCP-0.66/examples/lease_query.pl without any change.
> The packets on the wire look pretty much the same to me.
>
> I keep wondering..am I just getting something wrong?
> Am I missing a byte or bit somewhere that's throwing it off?
> Is the ISC DHCPd simply not going to respond no matter what
> I send it?
>
> I've tried sending from the same server, bouncing off the same
> nic/IP, bouncing off the local loopback, heck, I even tried
> sending to it via a unix socket like dhcpd will use to send to
> a local syslog daemon. Then I tried sending from a different system,
> even faking a valid relay's IP on our network. Nothing.
>    
I was trying it with the easiest configuration (hadn't believed it would 
work).
Client first obtained address (192.168.0.10) from Server (192.168.0.206),
then I killed the dhclient and started
sudo ./lease_query.pl 192.168.0.206 192.168.0.10
on client machine.
Server responded with DHCPLEASEACTIVE packet.
> According to one of the RFC's I was reading, I got the impression
> that any "server" that is responding to a relay's leasequery packet
> "should" throw out the packet if it looks like the giaddr (relay
> IP) has been spoofed to be the same as the server. Given that, maybe
> I can't send a packet to a dhcpd running on the same box that my
> code is running on? That would really suck as I have written a
> PHP based syslog daemon that replaces the real one, catches option-82
> info being logged, then wants to send a leasquery packet to dhcpd to
> query it for the remaining info about  the lease. Thus, I really
> need all the pieces to run on the same box. Failing that, I'd have to
> have another daemon running elsewhere that the PHP syslog daemon would
> have to send a message to and have it connect back to do the query.
> At that point, that's one more piece than I want in the equation,
> and one more piece that can break in a production environment.
>
> I'd really rather not have to hack on ISC's code to make it work
> the way I want and have to keep up with patching future versions, etc.
>
> Really fishing for ideas as to what to try next...
>
>    




More information about the dhcp-hackers mailing list