# Traffic Shaper setting on OPNsense ###### tags: `Traffic Shaper` ## 1. Topology ![](https://i.imgur.com/vZyPuaL.png) ## 2. Enable Shaper on OPNsense Test Case1: When want to set upload 10M and download 20M bandwidth. a. Add two bandwidth on pipes, one for 10M bandwidth another for 20M bandwidth. **Edit Pipe** (10M) | Option | Value | Note | | -------- | -------- |------| | Enabled | Checked | | | Bandwidth | 10 | | | Bandwidth Metric | Mbit/s | | | Mask | (none) | | | Enable CoDel | Unchecked | | | Enable PIE | Unchecked | | | Description | 10M | | **Edit Pipe** (20M) | Option | Value | Note | | -------- | -------- |------| | Enabled | Checked | | | Bandwidth | 20 | | | Bandwidth Metric | Mbit/s | | | Mask | (none) | | | Enable CoDel | Unchecked | | | Enable PIE | Unchecked | | | Description | 20M | | ![](https://i.imgur.com/Qqoy0lF.png) b. Add rules for limit download traffic **Edit rule** (20M) | Option | Value | Note | | -------- | -------- |------| | Enabled | Checked | | | Sequence | 1 | | | Interface | LAN | | | Proto | ip | | | Source | any | | | Invert source | Unchecked | | | Src-port | any | | | Destination | 192.168.1.0/24 | | | Invert destination | Unchecked | | | Dst-port | any | | | Target | 20M | | | Description | download 20M | | c. Add rule for limit up traffic **Edit rule** (10M) | Option | Value | Note | | -------- | -------- |------| | Enabled | Checked | | | Sequence | 2 | | | Interface | WAN | | | Proto | ip | | | Source | 192.168.1.0/24 | | | Invert source | Unchecked | | | Src-port | any | | | Destination | any | | | Invert destination | Unchecked | | | Dst-port | any | | | Target | 10M | | | Description | upload 10M | | ![](https://i.imgur.com/MNpfXhK.png) Test Case2: When want to set upload 10M and download 20M bandwidth per user. **Edit Pipe** (10M per user) | Option | Value | Note | | -------- | -------- |------| | Enabled | Checked | | | Bandwidth | 10 | | | Bandwidth Metric | Mbit/s | | | Mask | source | | | Enable CoDel | Unchecked | | | Enable PIE | Unchecked | | | Description | 10M | | **Edit Pipe** (20M per user) | Option | Value | Note | | -------- | -------- |------| | Enabled | Checked | | | Bandwidth | 20 | | | Bandwidth Metric | Mbit/s | | | Mask | destination | | | Enable CoDel | Unchecked | | | Enable PIE | Unchecked | | | Description | 20M | | Rules as the same test case 1. ## 3. Test shaper work normal a. Use PC1 open web browser go to speed test web site. https://www.speedtest.net/ b. Click Go button to verify traffic bandwidth and wait test result. ![](https://i.imgur.com/gHppBtC.png) c. Use PC1 and PC2 run speed test as the same time. It can get PC1 and PC2 Download and upload value as the same. (Download 19.2x Mbps, Upload 9.7x Mbps) ## Reference 1. [Limit maximum internet bandwidth users can consume](https://docs.opnsense.org/manual/how-tos/shaper_limit_per_user.html) 2. [Share internet bandwidth amongst users evenly](https://docs.opnsense.org/manual/how-tos/shaper_share_evenly.html)