Option 82 Logging

Patrick Trapp ptrapp at nex-tech.com
Wed Dec 24 20:22:57 UTC 2014


I'm not much help. The only instance of "if exists" I see in our config is 

if exists agent.circuit-id
{
        log ( error, concat( "Lease for ", binary-to-ascii (10, 8, ".", leased-address), " is connected to ", option agent.circuit-id));
}

which looks pretty similar to yours. Does it continue to fail if only one of the "if" statements is present? Does it fail if you try to use something like what I've posted here? This one has been working for us here for years, long enough ago that I'm not the one that created it. We use option 82 quite heavily on our network, though, without issue as long as I don't blunder.

Patrick
________________________________________
From: dhcp-users-bounces at lists.isc.org [dhcp-users-bounces at lists.isc.org] on behalf of Keith [kwoody at citywest.ca]
Sent: Wednesday, December 24, 2014 2:00 PM
To: dhcp-users at lists.isc.org
Subject: Option 82  Logging

I have been trying to get option 82 logging to work for the last while off a
test dslam
I have in the lab.

Here is a tcpdump capture:

11:44:14.087093 IP (tos 0x0, ttl 128, id 1723, offset 0, flags [none], proto UDP
(17), length 399)
    0.0.0.0.bootpc > 255.255.255.255.bootps: [udp sum ok] BOOTP/DHCP, Request
from 00:d0:59:3d:e7:e5 (oui Unknown), length 371, xid 0x61cbad08, secs 6912,
Flags [Broadcast] (0x8000)
          Client-Ethernet-Address 00:d0:59:3d:e7:e5 (oui Unknown)
          Vendor-rfc1048 Extensions
            Magic Cookie 0x63825363
            DHCP-Message Option 53, length 1: Discover
            NOAUTO Option 116, length 1: Y
            Client-ID Option 61, length 7: ether 00:d0:59:3d:e7:e5
            Requested-IP Option 50, length 4: 192.168.1.16
            Hostname Option 12, length 8: "CWPORT45"
            Vendor-Class Option 60, length 8: "MSFT 5.0"
            Parameter-Request Option 55, length 11:
              Subnet-Mask, Domain-Name, Default-Gateway, Domain-Name-Server
              Netbios-Name-Server, Netbios-Node, Netbios-Scope, Router-Discovery
              Static-Route, Classless-Static-Route-Microsoft, Vendor-Option
            Vendor-Option Option 43, length 2: 220.0
            Agent-Information Option 82, length 69:
              Circuit-ID SubOption 1, length 42:
Test-Dslam:1/2:0.35:VLAN=1:ifIndex=1003002
              Remote-ID SubOption 2, length 23: epserial=:epvendor=TCTN
            END Option 255, length 0
            PAD Option 0, length 0

My DHCP config:

default-lease-time 300;
max-lease-time 300;
allow bootp;
ddns-updates off;
ddns-update-style interim;

log-facility local7;

subnet 192.168.1.0 netmask 255.255.255.248 {
}

subnet 192.168.1.192 netmask 255.255.255.240 {

if exists agent.circuit-id {
  log (debug, concat("debug",option agent.circuit-id)); }

if exists agent.remote-id {
  log (info, concat("option-82 info is RID: ", option agent.remote-id)); }

        authoritative;
        option routers 192.168.1.1;
        range 192.168.1.193 192.168.1.206;
}
======

I see examples with concat, and taking just parts of the strings, but I just
can't figure out
the correct way to do this.

A discover comes in:

Dec 24 11:49:59 play dhcpd: DHCPDISCOVER from 00:d0:59:3d:e7:e5 via bge0:
network 192.168.1.0/29: no free leases

As soon as I remove the if statements the client gets a lease.

Have I got this ordered wrong? I have tried about a dozen different examples and
other variations. I just want it to log
this line:

Circuit-ID SubOption 1, length 42: Test-Dslam:1/2:0.35:VLAN=1:ifIndex=1003002

I have used DHCP for quite a number of years, but never used option 82 features
before, just a basic straight forward
config that has always worked.

Thanks,
Keith

_______________________________________________
dhcp-users mailing list
dhcp-users at lists.isc.org
https://lists.isc.org/mailman/listinfo/dhcp-users


More information about the dhcp-users mailing list