Location>code7788 >text

RK356X network speed limit

Popularity:547 ℃/2025-04-23 16:55:47

Downlink speed limit requires a virtual network portifb0To achieve

# Create a virtual network port ifb0 for traffic redirection and shaping
 ip link add ifb0 type ifb
 ip link set dev ifb0 up

 # Redirect inbound traffic to ifb0
 # Add an inbound queue qdisc on eth0
 tc qdisc add dev eth0 handle ffff: ingress
 # Add a filter on eth0 to redirect all IP packets to network port ifb0
 tc filter add dev eth0 parent ffff: protocol ip u32 match u32 0 0 action mirrored egress redirect dev ifb0

 # Add an HTB queue on the network port ifb0
 tc qdisc add dev ifb0 root handle 1: htb default 10
 # Create a class class, and the traffic matching this class will be limited to 500kbps
 tc class add dev ifb0 parent 1: classid 1:1 htb rate 500Kbit
 # Create a filter to match all traffic on ifb0 to the class created in the previous step
 tc filter add dev ifb0 protocol ip parent 1:0 prio 1 u32 match ip dst 0.0.0.0/0 flowid 1:1