Skip to content

WISPr-Bandwidth-Max-Up/Down values are divided by 1024 in fup.pl — rate limiting broken on Omada TP-Link #129

@Faneva-RK

Description

@Faneva-RK

My setup

  • FreeRADIUS 3.2.5 on Ubuntu 24.04
  • Mikrotik routers connected via WireGuard
  • TP-Link Omada access points also connected via WireGuard
  • RADIUSdesk managing FUP profiles with 4 stages

The problem

Users connecting through Omada access points get very low bandwidth (~4 Kbps)
even though their profile is set to 4/10 Mbps in RADIUSdesk.
The same profile works perfectly on Mikrotik devices.

What I found

After investigation, the issue is in fup.pl at lines 610-611:

$RAD_REPLY{'WISPr-Bandwidth-Max-Up'}   = int($up_value / 1024);
$RAD_REPLY{'WISPr-Bandwidth-Max-Down'} = int($down_value / 1024);

The value in $up_value is already in bps (e.g. 4194304 for 4 Mbps).
Dividing by 1024 sends 4096 to Omada, which reads it as 4096 bps (~4 Kbps).

radtest output before fix

WISPr-Bandwidth-Max-Up   = 4096
WISPr-Bandwidth-Max-Down = 10240
Mikrotik-Rate-Limit      = "4M/10M"

radtest output after fix

WISPr-Bandwidth-Max-Up   = 4194304
WISPr-Bandwidth-Max-Down = 10485760
Mikrotik-Rate-Limit      = "4M/10M"

The fix

Simply remove the / 1024 on both lines:

$RAD_REPLY{'WISPr-Bandwidth-Max-Up'}   = int($up_value);
$RAD_REPLY{'WISPr-Bandwidth-Max-Down'} = int($down_value);

Then restart FreeRADIUS (reload is not enough for Perl modules):

systemctl restart freeradius

Mikrotik is not affected by this fix as it uses Mikrotik-Rate-Limit,
not WISPr attributes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions