Traffic shaping (also known as “packet shaping”) is the control of computer network traffic in order to optimise or guarantee performance, lower latency, and/or increase usable bandwidth by delaying packets that meet certain criteria. More specifically, traffic shaping is any action on a set of packets (often called a stream or a flow), which imposes additional delay on those packets such that they conform to some predetermined constraint (a contract or traffic profile).

Easy and flexible

Traffic shaping within OPNsense is very flexible and is organised around pipes, queues and corresponding rules. The pipes define the allowed bandwidth, the queues can be used to set a weight within the pipe and finally the rules are used to apply the shaping to a certain package flow. The shaping rules are handled independently from the firewall rules and other settings.

Limit bandwidth

Bandwidth limitations can be defined based upon the interface(s), ip source & destination, direction of traffic (in/out) and port numbers (application).

Bandwidth sharing

The available bandwidth can be shared evenly over all users, this allows for optimum performance at all times.


Traffic can be prioritised by adding queues and defining weights. Applications with a higher weight can consume more bandwidth than others when the total available bandwidth is limited.