DHCP and ARP

async OPNsenseClient.get_arp_table(resolve_hostnames=False)

Return active ARP table entries.

Parameters:

resolve_hostnames (bool) – Whether reverse DNS lookups should be requested.

Returns:

ARP rows from OPNsense, optionally with resolved hostnames,

including fields such as IP address, MAC address, interface, expiration, and entry type when provided by the endpoint.

Return type:

list

async OPNsenseClient.get_dhcp_leases(opnsense_tz=None)

Return active DHCP leases grouped by interface.

Parameters:

opnsense_tz (tzinfo | None, optional) – Timezone used to localize ISC lease expiration timestamps. Fetched from OPNsense when omitted.

Returns:

Mapping with lease_interfaces keyed by

interface name and leases keyed by interface name. Lease entries are normalized across Kea, ISC DHCPv4, ISC DHCPv6, and dnsmasq and include address, hostname, interface, type, MAC, and expiration when available.

Return type:

dict[str, Any]