All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Regan <mysqlstudent@gmail.com>
To: lartc@vger.kernel.org
Subject: Packet matching difficulties
Date: Fri, 27 Feb 2015 17:09:41 +0000	[thread overview]
Message-ID: <54F0A4D5.7000902@gmail.com> (raw)

Hi,

I have a mail server on a 10mbit ethernet connection to the Internet 
that's sitting on a local gigabit network. I'm using the shaping 
primarily to control outbound SMTP from consuming all available 
bandwidth. However, I need more fine-grained control to not restrict the 
backup server (rsync over ssh) on the local LAN from also being 
throttled and be able to utilize the full gigabit network.

I realize I should probably be doing the shaping on the gateway 
firewall/router, but I was hoping to keep it simple by doing it directly 
on the mail server.

I believe the problem I may be having is with the matching of the source 
address and destination port. The source IP is the backup server and the 
destination port is ssh on the mail server.

I'm hoping someone can review my rules below and see what might be 
causing the rsync/ssh traffic to be filtered by classid 1:40 instead of 
classid 1:11:

tc qdisc del dev eth0 root
tc qdisc add dev eth0 root handle 1: htb default 50
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 2mbit ceil 4mbit 
burst 15k prio 1
tc class add dev eth0 parent 1:1 classid 1:11 htb rate 900mbit ceil 
1000mbit burst 15k prio 1
tc class add dev eth0 parent 1:1 classid 1:20 htb rate 3mbit ceil 4mbit 
burst 15k prio 1
tc class add dev eth0 parent 1:1 classid 1:30 htb rate 3mbit ceil 4mbit 
burst 15k prio 1
tc class add dev eth0 parent 1:1 classid 1:40 htb rate 512kbit ceil 
1mbit burst 15k prio 1
tc class add dev eth0 parent 1:1 classid 1:50 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:11 handle 11: sfq perturb 10
tc qdisc add dev eth0 parent 1:20 handle 20: sfq perturb 10
tc qdisc add dev eth0 parent 1:30 handle 30: sfq perturb 10
tc qdisc add dev eth0 parent 1:40 handle 40: sfq perturb 10
tc qdisc add dev eth0 parent 1:50 handle 50: sfq perturb 10
tc filter add dev eth0 protocol ip parent 1: prio 1 u32 match ip dport 
25 0xffff flowid 1: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:11
tc filter add dev eth0 protocol ip parent 1: prio 1 u32 match ip sport 
80 0xffff flowid 1:20
tc filter add dev eth0 protocol ip parent 1: prio 1 u32 match ip sport 
443 0xffff flowid 1:20
tc filter add dev eth0 protocol ip parent 1: prio 1 u32 match ip sport 
110 0xffff flowid 1:30
tc filter add dev eth0 protocol ip parent 1: prio 1 u32 match ip sport 
143 0xffff flowid 1:30
tc filter add dev eth0 protocol ip parent 1: prio 1 u32 match ip sport 
993 0xffff flowid 1:30
tc filter add dev eth0 protocol ip parent 1: prio 1 u32 match ip sport 
995 0xffff flowid 1:30
tc filter add dev eth0 protocol ip parent 1: prio 1 u32 match ip sport 
465 0xffff flowid 1:30
tc filter add dev eth0 protocol ip parent 1: prio 1 u32 match ip sport 
587 0xffff flowid 1:30
tc filter add dev eth0 protocol ip parent 1: prio 1 u32 match ip sport 
22 0xffff flowid 1:40

Thanks,
Alex

                 reply	other threads:[~2015-02-27 17:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=54F0A4D5.7000902@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.