Skip to content

Instantly share code, notes, and snippets.

@datsenko
Forked from beardicus/edgerouter-qos
Last active January 14, 2016 00:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save datsenko/517c3a3c92c989ee002a to your computer and use it in GitHub Desktop.
Save datsenko/517c3a3c92c989ee002a to your computer and use it in GitHub Desktop.
EdgeRouter Lite QOS Settings
# http://поток.укр
# fair-queue based settings for EdgeRouter Lite traffic shaping
#
# download is typically 30 and change. everything can burst to 100%
# of bandwidth, priority rules keep the garbage in check
# =======================================================================
set traffic-policy shaper download
set traffic-policy shaper download bandwidth 12Mbit
# =======================================================================
# DOWNLOAD - eth2
# =======================================================================
# set DEFAULT download priority:
set traffic-policy shaper download default bandwidth 40%
set traffic-policy shaper download default ceiling 70%
set traffic-policy shaper download default priority 7
set traffic-policy shaper download default queue-type fair-queue
# =======================================================================
# very high priority DNS,SSH,ICMP:
set traffic-policy shaper download class 10 bandwidth 10%
set traffic-policy shaper download class 10 ceiling 20%
set traffic-policy shaper download class 10 priority 0
set traffic-policy shaper download class 10 queue-type fair-queue
set traffic-policy shaper download class 10 match icmp ip protocol icmp
set traffic-policy shaper download class 10 match ssh ip source port 22
set traffic-policy shaper download class 10 match dns ip source port 53
# =======================================================================
# very high priority VoIP (RTP,SIP):
set traffic-policy shaper download class 10 description "RTP"
set traffic-policy shaper download class 10 bandwidth 10%
set traffic-policy shaper download class 10 ceiling 50%
set traffic-policy shaper download class 10 match VOIP-RTP ip dscp 46
#
set traffic-policy shaper download class 10 description "SIP"
set traffic-policy shaper download class 10 bandwidth 10%
set traffic-policy shaper download class 10 ceiling 50%
set traffic-policy shaper download class 10 match VOIP-SIP ip dscp 24
# ======================================================================
# HTTP, HTTPS:
set traffic-policy shaper download class 20 bandwidth 10%
set traffic-policy shaper download class 20 ceiling 100%
set traffic-policy shaper download class 20 priority 3
set traffic-policy shaper download class 20 queue-type fair-queue
set traffic-policy shaper download class 20 match http ip source port 80
set traffic-policy shaper download class 20 match https ip source port 443
# =========================================================================
# bittorrent:
set traffic-policy shaper download class 30 bandwidth 10%
set traffic-policy shaper download class 30 ceiling 20%
set traffic-policy shaper download class 30 priority 7
set traffic-policy shaper download class 30 queue-type fair-queue
#set traffic-policy shaper download class 30 match bittorrent ip source port 6881-6889
set traffic-policy shaper download class 30 match transmission ip source port 51413
# =========================================================================
set interfaces ethernet eth2 traffic-policy out download
# =========================================================================
# UPLOAD - eth0
# =========================================================================
#
set traffic-policy shaper upload
set traffic-policy shaper upload bandwidth 10Mbit
# =================================================================
# high priority DNS, SSH, ICMP:
set traffic-policy shaper upload class 2 bandwidth 10%
set traffic-policy shaper upload class 2 ceiling 20%
set traffic-policy shaper upload class 2 priority 0
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 ssh ip destination port 22
set traffic-policy shaper upload class 2 match dns ip destination port 53
#
# very high priority VoIP (SIP, RTP):
set traffic-policy shaper upload class 2 bandwidth 10%
set traffic-policy shaper upload class 2 ceiling 50%
set traffic-policy shaper upload class 2 match VOIP-RTP ip dscp 46
#
set traffic-policy shaper upload class 2 description "SIP"
set traffic-policy shaper upload class 2 bandwidth 10%
set traffic-policy shaper upload class 2 ceiling 50%
set traffic-policy shaper upload class 2 match VOIP-SIP ip dscp 24
# ========================================================================
# high priority HTTP, HTTPS:
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 3
set traffic-policy shaper upload class 5 queue-type fair-queue
set traffic-policy shaper upload class 5 match http ip destination port 80
set traffic-policy shaper upload class 5 match https ip destination port 443
# ============================================================================
# everything else is middle-of-the-road priority
set traffic-policy shaper upload default bandwidth 50%
set traffic-policy shaper upload default ceiling 70%
set traffic-policy shaper upload default priority 5
set traffic-policy shaper upload default queue-type fair-queue
# ============================================================================
# crashplan traffic only, set DSCP to 32 in crashplan, matches 8 here (?)
set traffic-policy shaper upload class 10 bandwidth 10%
set traffic-policy shaper upload class 10 ceiling 50%
set traffic-policy shaper upload class 10 priority 2
set traffic-policy shaper upload class 10 queue-type fair-queue
set traffic-policy shaper upload class 10 match crashplan ip dscp 8
# ========================================================================
# Bittorrent from transmission client on default port
set traffic-policy shaper upload class 20 bandwidth 10%
set traffic-policy shaper upload class 20 ceiling 20%
set traffic-policy shaper upload class 20 priority 7
set traffic-policy shaper upload class 20 queue-type fair-queue
set traffic-policy shaper upload class 20 match bittorrent ip source port 51413
#
# ========================================================================
set interfaces ethernet eth0 traffic-policy out upload
#
commit
save
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment