Skip to content

Instantly share code, notes, and snippets.

@mlomeli
Forked from beardicus/edgerouter-qos
Last active September 30, 2016 13:17
Show Gist options
  • Select an option

  • Save mlomeli/991961d3f9064f027ae0 to your computer and use it in GitHub Desktop.

Select an option

Save mlomeli/991961d3f9064f027ae0 to your computer and use it in GitHub Desktop.
#
# QOS GAMING EDGEROUTER
## 1. Prerequisites
### 1.1 define port-groups
(eg. gaming browsing downloading(usenet,torrent))
### 1.2. define an accept rule for each port-group src dest
rule | portgroup
-----| -----------
1 | super ssh dns
2 | gaming
3 | downloading
# upload is typically 5.5-ish. should be clamped at less than 100%
# of advertised bandwidth to avoid buffer bloat and lag
set traffic-policy shaper upload
set traffic-policy shaper upload bandwidth 500Kbit
# high priority, interactive, ssh, dns, icmp
set traffic-policy shaper upload class 2 bandwidth 10%
set traffic-policy shaper upload class 2 ceiling 100%
set traffic-policy shaper upload class 2 priority 5
set traffic-policy shaper upload class 2 queue-type fair-queue
set traffic-policy shaper upload class 2 queue-limit 16
set traffic-policy shaper upload class 2 match icmp ip protocol icmp
set traffic-policy shaper upload class 2 match superssh mark 1
# high priority but not quite so much
set traffic-policy shaper upload class 5 bandwidth 10%
set traffic-policy shaper upload class 5 ceiling 100%
set traffic-policy shaper upload class 5 priority 4
set traffic-policy shaper upload class 5 queue-type fair-queue
set traffic-policy shaper upload class 5 match gaming mark 2
# high priority but not quite so much, http, https
set traffic-policy shaper upload class 6 bandwidth 10%
set traffic-policy shaper upload class 6 ceiling 100%
set traffic-policy shaper upload class 6 priority 3
set traffic-policy shaper upload class 6 queue-type fair-queue
set traffic-policy shaper upload class 6 match http ip destination port 80
set traffic-policy shaper upload class 6 match https ip destination port 443
# everything else is middle-of-the-road priority
set traffic-policy shaper upload default bandwidth 60%
set traffic-policy shaper upload default ceiling 100%
set traffic-policy shaper upload default priority 2
set traffic-policy shaper upload default queue-type fair-queue
# torrent & usenet
set traffic-policy shaper upload class 20 bandwidth 10%
set traffic-policy shaper upload class 20 ceiling 100%
set traffic-policy shaper upload class 20 priority 1
set traffic-policy shaper upload class 20 queue-type fair-queue
set traffic-policy shaper upload class 20 match downloading mark 3
set interfaces ethernet eth1 traffic-policy out upload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment