Skip to main content

DHCP/IPoE

Built-in DHCP server for IPoE subscribers — no external DHCP server required.

Overview

AthenaBNG includes abng-dhcpd, a purpose-built DHCP server for broadband subscriber management. Unlike general-purpose DHCP servers, abng-dhcpd is designed specifically for BNG use cases:

  • Works on dynamically-created VLAN interfaces with no IP address
  • RADIUS authentication per subscriber (MAC-based)
  • Unnumbered /32 addressing for broadband access
  • Full RADIUS accounting with real interface traffic counters
  • Integrated with the BNG session lifecycle

Why a Built-in DHCP Server?

Traditional DHCP servers (ISC Kea, dnsmasq) require an IP address on the interface they listen on. In a dynamic VLAN environment where interfaces are created on-demand by the demux daemon, there's no IP address until RADIUS tells us what to assign.

abng-dhcpd solves this by using AF_PACKET sockets — the same technology used by the VLAN demux daemon — to capture DHCP frames directly from the wire, with no IP required on the interface.

How It Works

  1. Subscriber sends DHCP Discover on their VLAN interface
  2. abng-dhcpd captures the frame via AF_PACKET relay
  3. Option 82 injected — Circuit ID = interface name, Remote ID = BNG hostname
  4. RADIUS Access-Request sent with subscriber MAC as username
  5. RADIUS returns Framed-IP-Address, rates, and session parameters
  6. DHCP Offer sent back to subscriber with assigned IP
  7. Subscriber sends Request, server sends ACK
  8. Session created — QoS applied, accounting started, abngd notified

RADIUS-Driven IP Assignment

IP addresses come from your RADIUS server, not from a local pool. This gives you full control over IP assignment policy in one place:

  • Assign static IPs per subscriber
  • Assign from pools based on subscriber class
  • Different subnets for different service tiers
  • Easy integration with your existing provisioning system

Accounting

abng-dhcpd implements full RFC 2866 RADIUS accounting:

EventAcct-Status-TypeWhen
Session confirmedStartDHCP ACK sent
Periodic updateInterim-UpdateEvery 5 minutes (configurable)
Subscriber releasesStop (User-Request)DHCP Release received
Lease expiresStop (Session-Timeout)Lease timer expires
BNG shutdownStop (NAS-Reboot)Graceful shutdown

Traffic counters are read from the Linux kernel's interface statistics — real bytes and packets, not estimates.

Configuration

dhcp:
enabled: true
lease_time: 3600
allocation_mode: "radius"
unnumbered: true
pools:
- network: "10.100.0.0/23"
gateway: "10.100.0.1"
dns_servers:
- "1.1.1.1"
- "8.8.8.8"