go-dhcplogger

command module
v0.0.0-...-948c2b2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2023 License: BSD-3-Clause Imports: 16 Imported by: 0

README

go-dhcplogger

Build Status

Package for capturing and logging all sent DHCPACK packets on an interface. May be useful for auditing purposes.

Preparations

Packets are sent to a PostgreSQL database, the table may be prepared with the following statement:

CREATE TABLE dhcp4_log (
    id        bigserial primary key,
    ts        timestamptz not null,
    client    macaddr not null,
    agent     varchar(256),
    ip        inet not null,
    leasetime integer,
    packet    text
);

Invocation

The program may be run as:

# ./go-dhcplogger -interface=eth0

For all switches and defaults, see

# ./go-dhcplogger -h

Operation

The program starts listening for dhcp packets on the specified interface. Each packet is parsed and stored in SQL. 4 goroutines are used for this. If for some reason the sql is unavailable, up to -max-queue-length packets will be queued. All packets are retried -retries times with 1 second delays, then dropped.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL