Hi everyone,
I’m trying to manage my network on my GL.iNet router running OpenWrt, and I want to limit the bandwidth for UDP traffic for a specific IP or device. I’ve looked into QoS and traffic shaping, but most guides I’ve found either cover total bandwidth per device or TCP/UDP together.
My goal is to specifically throttle UDP traffic without affecting TCP traffic for that device. Ideally, I’d like to:
Has anyone done something like this before? Could you share a configuration example or point me to the right tools/packages in OpenWrt to achieve this?
Thanks in advance for your help!
To achieve specific UDP bandwidth throttling for an IP on OpenWrt, you must use iptables (or nftables) to mark packets belonging to the UDP protocol for the target device (e.g., 192.168.1.100). Once marked, the packets can be controlled by the Traffic Control (tc) utility, which uses queuing disciplines like HTB (Hierarchy Token Bucket). You define a specific traffic class in tc that matches the firewall mark, allowing you to set a precise maximum upload and download rate for UDP traffic alone without affecting the TCP traffic flowing through a different, unrestricted class. While packages like luci-app-sqm or luci-app-qos can simplify the underlying tc configuration, the most precise and reliable method is manual configuration using iptables for marking and tc commands for shaping.
1 Like
Thanks for the explanation. Could you provide a concrete example of the iptables/nftables marking rules and the corresponding tc (HTB or similar) configuration that would limit UDP bandwidth for a single IP? I’m especially looking for:
-
The exact commands or config snippets to mark UDP traffic for 192.168.x.x.
-
The HTB class and filter rules needed to enforce a specific rate limit.
-
How to make the configuration persistent across reboots on OpenWrt/GL.iNet.
A runnable example would help a lot. Thanks!