PacketFence is a fully supported, trusted, Free and Open Source network access control (NAC) solution. Boasting an impressive feature set including a captive-portal for registration and remediation, centralized wired and wireless management, powerful BYOD management options, 802.1X support, layer-2 isolation of problematic devices; PacketFence can be used to effectively secure networks small to very large heterogeneous networks.
To Reproduce
Setup packetfence in inline mode with netflow.
Expected behavior
bandwidth accounting of inline nodes
Additional context
I have an inline installation of version 13.1.
The netflow accounting is not working.
After some debugging I see in that /usr/local/pf/go/cmd/pfacct/net_flow.go does the following on line 58
INSERT INTO bandwidth_accounting (node_id, tenant_id, mac, unique_session_id, time_bucket, in_bytes, out_bytes, source_type)
Refer to https://github.com/inverse-inc/packetfence/blob/devel/go/cmd/pfacct/net_flow.go
However the 13.1 and 13.2 schemas in /usr/local/pf/db have the following
CREATE TABLE bandwidth_accounting (
node_id BIGINT UNSIGNED NOT NULL,
unique_session_id BIGINT UNSIGNED NOT NULL,
time_bucket DATETIME NOT NULL,
source_type ENUM('net_flow','radius') NOT NULL,
in_bytes BIGINT SIGNED NOT NULL,
out_bytes BIGINT SIGNED NOT NULL,
mac CHAR(17) NOT NULL,
last_updated DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
total_bytes BIGINT SIGNED AS (in_bytes + out_bytes) VIRTUAL,
PRIMARY KEY (node_id, time_bucket, unique_session_id),
KEY bandwidth_aggregate_buckets (time_bucket, node_id, unique_session_id, in_bytes, out_bytes),
KEY bandwidth_source_type_time_bucket (source_type, time_bucket),
KEY bandwidth_last_updated_source_type_time_bucket (last_updated, source_type, time_bucket),
KEY bandwidth_node_id_unique_session_id_last_updated (node_id, unique_session_id, last_updated),
KEY bandwidth_accounting_mac_last_updated (mac, last_updated)
) ENGINE=InnoDB DEFAULT CHARACTER SET = 'utf8mb4' COLLATE = 'utf8mb4_general_ci';
I see that tenant_id was removed from the table in version 12.0.
The CREATE TABLE does not have the tenant_id. Inline accounting is not working as the INSERTs are failing.
The Changelog has the following:
commit d8ec20cbccd2f51af945557e5062c94b33bdfb81
Author: James Rouzier jrouzier@inverse.ca
Date: Mon Oct 31 15:31:58 2022 -0400
Describe the bug Inline accounting not working
To Reproduce Setup packetfence in inline mode with netflow.
Expected behavior bandwidth accounting of inline nodes
Additional context I have an inline installation of version 13.1.
The netflow accounting is not working.
After some debugging I see in that /usr/local/pf/go/cmd/pfacct/net_flow.go does the following on line 58 INSERT INTO bandwidth_accounting (node_id, tenant_id, mac, unique_session_id, time_bucket, in_bytes, out_bytes, source_type) Refer to https://github.com/inverse-inc/packetfence/blob/devel/go/cmd/pfacct/net_flow.go
However the 13.1 and 13.2 schemas in /usr/local/pf/db have the following
CREATE TABLE bandwidth_accounting (
node_id
BIGINT UNSIGNED NOT NULL,unique_session_id
BIGINT UNSIGNED NOT NULL,time_bucket
DATETIME NOT NULL,source_type
ENUM('net_flow','radius') NOT NULL,in_bytes
BIGINT SIGNED NOT NULL,out_bytes
BIGINT SIGNED NOT NULL,mac
CHAR(17) NOT NULL,last_updated
DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,total_bytes
BIGINT SIGNED AS (in_bytes + out_bytes) VIRTUAL, PRIMARY KEY (node_id, time_bucket, unique_session_id), KEY bandwidth_aggregate_buckets (time_bucket, node_id, unique_session_id, in_bytes, out_bytes), KEY bandwidth_source_type_time_bucket (source_type, time_bucket), KEY bandwidth_last_updated_source_type_time_bucket (last_updated, source_type, time_bucket), KEY bandwidth_node_id_unique_session_id_last_updated (node_id, unique_session_id, last_updated), KEY bandwidth_accounting_mac_last_updated (mac, last_updated) ) ENGINE=InnoDB DEFAULT CHARACTER SET = 'utf8mb4' COLLATE = 'utf8mb4_general_ci';I see that tenant_id was removed from the table in version 12.0.
The CREATE TABLE does not have the tenant_id. Inline accounting is not working as the INSERTs are failing.
The Changelog has the following: commit d8ec20cbccd2f51af945557e5062c94b33bdfb81 Author: James Rouzier jrouzier@inverse.ca Date: Mon Oct 31 15:31:58 2022 -0400