All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Regan <mysqlstudent@gmail.com>
To: lartc@vger.kernel.org
Subject: HTB and src/dst filters
Date: Sat, 28 Feb 2015 19:01:24 +0000	[thread overview]
Message-ID: <54F21084.6080608@gmail.com> (raw)

Hi,
I posted a message a few days ago and haven't received any responses, so 
thought I would try and simplify my post and ask a few more specific 
questions.

I'm using tc on fedora20 and can't figure out why I can't get it to 
filter ssh traffic originating from the backup server to port 22 on the 
mail server.

tc qdisc del dev eth0 root
tc qdisc add dev eth0 root handle 1: htb default 20
tc class add dev eth0 parent 1: classid 1:1 htb rate 1000mbit burst 15k
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 900mbit ceil 
1000mbit burst 15k prio 1
tc class add dev eth0 parent 1:1 classid 1:20 htb rate 2mbit ceil 3mbit 
burst 15k prio 1
tc qdisc add dev eth0 parent 1:10 handle 10: sfq perturb 10
tc qdisc add dev eth0 parent 1:20 handle 20: sfq perturb 10
tc filter add dev eth0 protocol ip parent 1: prio 1 u32 match ip src \
     1.2.3.4/32 match ip dport 22 0xffff flowid 1:10

I'm expecting ssh traffic from 1.2.3.4 to be filtered through 1:10 while 
everything else to be sent through 1:20.

I'm aware of how to display the traffic counts with 'tc ls' but is there 
a way to monitor the actual packets on a specific filter?

Can I assume that if I have two filters set up that the traffic is going 
through either one or the other?

I was also confused by some of the examples that used port 80 (or 22 in 
my case) as the SOURCE port:

On source/destination port, all IP protocols
     Source: 'match ip sport 80 0xffff', destination: 'match ip dport 80 
0xffff'

How would you ever have port 80 as a SOURCE? Any connections to a web 
server is going to use an unprivileged high port to DESTINATION port 80, 
correct?

Thanks,
Alex

             reply	other threads:[~2015-02-28 19:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-28 19:01 Alex Regan [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-03-02 15:39 HTB and src/dst filters Mike Schmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54F21084.6080608@gmail.com \
    --to=mysqlstudent@gmail.com \
    --cc=lartc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.