Skip to content

Count IPv6 traffic in virtual router network usage #14591

Open

Description

@MitchDrage

On isolated and VPC networks, the virtual router's usage scripts only read its iptables counters, so only IPv4 traffic is counted for network usage. IPv6 traffic goes through nftables, and those counters aren't read.
If a network has IPv6 enabled, VMs can send as much IPv6 traffic as they like and none of it shows up in usage.

Shared networks already count IPv6. They take usage from the libvirt stats on each VM's NIC. Those stats also pick up traffic between VMs on the same network, plus DHCP, ARP and ND.

It would be good to have routers count IPv6 too. That way, usage on a dual-stack network covers all of a VM's traffic.

This came up while working on #14578.
#14583 accepts IPv6 entries in network.usage.exempt.cidrs, but routers can't use them until they count IPv6.
A follow-up PR will apply them to shared networks. I'm working on it now and will link it here once it's raised.

Activity

  1. github-actions commented on Nov 6, 2026

    @github-actions

    Warning

    threat detection engine error
    The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.

    What happened

    The threat detection engine failed to produce results.

    Review the workflow run logs for details.

    🎯 Triage report

    On isolated and VPC networks, the virtual router counts only IPv4 traffic for network usage, because its counters use iptables while IPv6 goes through nftables. A dual-stack network therefore under-reports usage. Shared networks already count IPv6 via libvirt NIC stats. The reporter proposes that routers count IPv6 too, so usage is consistent. This is linked to #14578 and to the IPv6 exemption config added in #14583.

    📊 Assessment

    Dimension Value Reasoning
    Type type:enhancement Feature gap in usage accounting; no crash or regression reported
    Component component:virtual-router, component:usage-server Counters live on the VR; records feed the usage server
    Severity n/a Not a bug report
    Labels type:enhancement, component:virtual-router, component:usage-server Based only on the issue text
    Coding agent Needs more info Direction is clear, but the nftables counter design and how it interacts with #14583 need maintainer input

    🔗 Similar issues

    💡 Notes and suggestions
    • The issue names Allow exclusion of chosen addresses from virtual router usage counters #14583 as the source of the network.usage.exempt.cidrs IPv6 entries. Maintainers may want to confirm whether routers should count IPv6 before the exemption list is used for VR networks.
    • Check how the VR counters are read today (iptables vs nft) before choosing an approach. The issue does not address this.

    Generated by Daily Issue Triage · copilot · haiku55 · ~3 AIC · ⊞ 3.8K · ◷

    Add this agentic workflow to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/daily-issue-triage.md@139fa09ef17cde4135e696ff8e7af09bc5ddfa6e
    
  2. weizhouapache commented on Nov 6, 2026

    @weizhouapache
    Member

    as I remember, the nftables rules also have some counters

  3. MitchDrage commented on Nov 7, 2026

    @MitchDrage
    ContributorAuthor

    as I remember, the nftables rules also have some counters

    Ok yes you are correct - the IPv6 firewall rules do have counters, but only on the default rule at the end of each chain and they reset when the rules are reapplied.
    I'm looking at adding dedicated IPv6 usage counters in nftables, the same way IPv4 uses its own NETWORK_STATS chains in iptables.

    I've corrected the issue description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions