Re: DHCP information option

From: Petr Lapukhov <petr_at_internetworkexpert.com>
Date: Mon, 20 Jul 2009 18:10:16 -0700

Hi,

There is a couple of ways to do that using just IOS CLI. We actually
have them explained in our VOL1/VOL4 workbooks (yes, some nasty DHCP
troubleshooting scenarios :)

Firstly, you may use the "debug ip packet dump" command to inspect the
content of the incoming DHCP packets. You just need to undestand the
packet format and be able to locate option 82 in there (starts with
0x52 followed by option length). Oh dont forget an access-list with
the command to match only the DHCP packets or you may end up in a
mess.

There is another "less" complicated way though.

1) Create a bogus DHCP class, like the following:

ip dhcp class TEST
   relay agent information
      relay-information hex 000000000

Notice that the class should has a relay-information configured.

2) Associate this class with the DHCP pool that matches your remote
relay IP (giaddr), e.g.

ip dhcp pool VLAN57
   network 204.12.1.0 255.255.255.0
   class TEST
      address range 204.12.1.100 204.12.1.100

3) Enable the "debug ip dhcp server class" command and let the client
obtain an IP address via DHCP. The respective relay should be
inserting the DHCP option 82 of course. For example a relay could be
configured as follows:

ip dhcp relay information option
!
interface Fa 0/0
 ip dhcp relay information option subscriber-id TEST

if it's an IOS router.

Finally, the debugs on the server should display something like the following:

DHCPD: Class 'TEST' matched by default
DHCPD: Searching for a match to 'relay-information
020c020a0000cc0c010200000000060454455354' in class TEST

Which only happens when the incoming option 82 DOES NOT match a class
:) Go figure why cisco did that. Now the value above is the actual
Option 82 content (not including the option number/length tuple).
Remember that you can use the globbing "*" in the relay information
pattern or use wildcard masks.

Lastly, if you want to know why Cisco made it so painful - it's
probably due to the "non-standartized" format for Option 82, which
forces you using raw hex string to match incoming packets.

HTH

-- 
Petr Lapukhov, petr_at_INE.com
CCIE #16379 (R&S/Security/SP/Voice)
Internetwork Expert, Inc.
http://www.INE.com
Toll Free: 877-224-8987
Outside US: 775-826-4344
2009/7/20 Ahmed Batt <engbatt_at_gmail.com>:
> Dears,
>
> when we use DHCP option 82, we use hex value to define the agent relay,
> kindly please tell me how we can find this hex value.
>
> BR
> Ahmed Batt
>
>
> Blogs and organic groups at http://www.ccie.net
>
> _______________________________________________________________________
> Subscription information may be found at:
> http://www.groupstudy.com/list/CCIELab.html
Blogs and organic groups at http://www.ccie.net
Received on Mon Jul 20 2009 - 18:10:16 ART

This archive was generated by hypermail 2.2.0 : Sat Aug 01 2009 - 13:10:22 ART