• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 405
  • Last Modified:

packet shaping tc question

Hi everyone, I tried following the tutorial here:


There's actually several tutorials.  It's the second one that starts with "Example: HTTP Outbound Traffic Shaping"

So here's what happens when I run that.  First off, it seems to work at first!  But after a bit more testing I find out that it's working a bit TOO well.  It seems to be shaping all IP traffic regardless of the iptables marking etc.  I know this because even when I stop iptables, my downloads are STILL throttled.  Anyway my downloads shouldn't be throttled at all regardless because from what I can tell only OUTBOUND traffic should be affected.

I'm VERY green with tc, so I'm sure that there is plenty I'm missing.  I've read through the man pages, and can't seem to find out what I'm missing.  Any assistance would be much appreciated.

  • 2
1 Solution
schnibitzAuthor Commented:
I got it working finally.  You need to specify the iptable stuff first, then the rest.  The "default" portion of TC was causing shaping to occur regardless of port 80 traffic being matched.  Will post final working code tomorrow.
schnibitzAuthor Commented:
#First delete existing rules for eth0
tc qdisc del dev eth0 root
#delete rules in iptables (dangerous)
iptables -t mangle -F
iptables -t mangle -A OUTPUT -p tcp --dport 80 -j MARK --set-mark 10
tc qdisc add dev eth0 root handle 1: htb
tc class add dev eth0 parent 1: classid 1:1 htb rate 256bps ceil 256bps

tc class add dev eth0 parent 1:1 classid 1:10 htb rate 256bps ceil 256bps prio 0
tc filter add dev eth0 parent 1:0 prio 1 protocol ip handle 10 fw flowid 1:10

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now