Skip to content

Commit 4529b8d

Browse files
committedJul 2, 2012
A few small cleanups to make it easier for others to use out of the box.
1 parent b11af30 commit 4529b8d

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed
 

‎src-3tos.sh

+12-11
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# High Normal Low [Priority classes are named 1:(HOST_BUCKET * 100 + 1)]
1515
# |
1616
# Flow Bucket 1 .. NUM_FLOW_BUCKETS [Flow QDiscs are named (HOST_BUCKET * 100 + 1 + 1):0]
17-
#
17+
#
1818
# The 0->NUM_FLOW_BUCKETS exist under every high, normal and low class.
1919
#
2020
# Yes, the class and QDisc naming is confusing and there are probably bugs
@@ -24,7 +24,8 @@
2424
# Config
2525
####
2626

27-
TC="/usr/local/sbin/tc"
27+
#TC="/usr/local/sbin/tc"
28+
TC=`which tc`
2829

2930
DEVICE="ppp0"
3031

@@ -91,20 +92,20 @@ MTU="1456"
9192
# For 5-tuple (flow) fairness use
9293
#FLOW_KEYS="src,dst,proto,proto-src,proto-dst"
9394
# For 5-tuple (flow) fairness with NAT use
94-
#FLOW_KEYS="nfct-src,nfct-dst,nfct-proto,nfct-proto-src,nfct-proto-dst"
95+
FLOW_KEYS="nfct-src,nfct-dst,nfct-proto,nfct-proto-src,nfct-proto-dst"
9596
# For 5-tuple (flow) fairness with IPIP IPIPv6, IPv6IP, IPv6IPv6 tunnels (no NAT) use
9697
# This requires my recent patch to the flow classifier.
97-
FLOW_KEYS="src,dst,proto,proto-src,proto-dst,tunnel-src,tunnel-dst,proto,tunnel-proto-src,tunnel-proto-dst"
98+
#FLOW_KEYS="src,dst,proto,proto-src,proto-dst,tunnel-src,tunnel-dst,proto,tunnel-proto-src,tunnel-proto-dst"
9899

99100
####
100101
# The keys that are used to identify a host's traffic.
101102
####
102103
# No NAT
103104
#HOST_KEYS="src"
104105
# With NAT
105-
#HOST_KEYS="nfct-src"
106+
HOST_KEYS="nfct-src"
106107
# With IPIP IPIPv6, IPv6IP, IPv6IPv6 tunnels (no NAT)
107-
HOST_KEYS="src,tunnel-src"
108+
#HOST_KEYS="src,tunnel-src"
108109

109110
# Set R2Q (HTB knob) low because of the low bitrates.
110111
# If your rates aren't low you might not need this. Remove it from the
@@ -208,7 +209,7 @@ for HOST_NUM in `seq ${NUM_HOST_BUCKETS}`; do
208209
tc class add dev ${DEVICE} parent 1:1 classid 1:${QID} htb rate ${DIV_RATE}kbit ceil ${RATE}kbit prio 0 linklayer ${LINKLAYER} overhead ${OVERHEAD}
209210

210211
###
211-
# Within each host bucket add three classes, high, normal and low priority.
212+
# Within each host bucket add three sub-classes, high, normal and low priority.
212213
# Priority classes are named 1:[HOST_BUCKET * 100 + 1]
213214
###
214215
QID_1=`expr $QID '*' 100 + 1`
@@ -255,7 +256,7 @@ for HOST_NUM in `seq ${NUM_HOST_BUCKETS}`; do
255256
# R= Reliability bit
256257
#
257258
# OpenSSH terminal sets D.
258-
# OpenSSH SCP sets T.
259+
# OpenSSH SCP/SFTP sets T.
259260
# It's easy to configure the Transmission Bittorrent client to set T (settings.json).
260261
# For home VoIP devices use an Iptables rule to set all of their traffic to have D.
261262
#
@@ -267,14 +268,14 @@ for HOST_NUM in `seq ${NUM_HOST_BUCKETS}`; do
267268
# D bit set.
268269
tc filter add dev ${DEVICE} parent 1:${QID} protocol ip prio 10 u32 match ip tos 0x10 0x1c flowid 1:${QID_1}
269270

270-
# T bit set.
271-
tc filter add dev ${DEVICE} parent 1:${QID} protocol ip prio 10 u32 match ip tos 0x08 0x1c flowid 1:${QID_3}
272-
273271
# Diffserv expedited forwarding. Put this in the high priority class.
274272
# Some VoIP clients set this (ie Ekiga).
275273
# DSCP=b8
276274
tc filter add dev ${DEVICE} parent 1:${QID} protocol ip prio 10 u32 match ip tos 0xb8 0xfc flowid 1:${QID_1}
277275

276+
# T bit set.
277+
tc filter add dev ${DEVICE} parent 1:${QID} protocol ip prio 10 u32 match ip tos 0x08 0x1c flowid 1:${QID_3}
278+
278279
# Everything else into default.
279280
tc filter add dev ${DEVICE} parent 1:${QID} protocol ip prio 10 u32 match ip tos 0x00 0x00 flowid 1:${QID_2}
280281
done

0 commit comments

Comments
 (0)