From: Mathew Brown Date: Thu, 29 Jun 2006 19:38:02 +0000 Subject: [LARTC] Matching outgoing ssh traffic if ssh connection initiated Message-Id: <20060629193802.21376.qmail@web55706.mail.re3.yahoo.com> MIME-Version: 1 Content-Type: multipart/mixed; boundary="===============1835568224==" List-Id: To: lartc@vger.kernel.org --===============1835568224== Content-Type: multipart/alternative; boundary="0-1316458810-1151609882=:16975" Content-Transfer-Encoding: 8bit --0-1316458810-1151609882=:16975 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit In regards to my earlier post, I believe that my problem is that the filter is not matching ssh traffic properly. Here are the rules that I posted earlier, with the filter being the last one: tc qdisc add dev eth0 root handle 1: htb default 3 tc class add dev eth0 parent 1: classid 1:1 htb rate 102400kbps ceil 102400kbps tc class add dev eth0 parent 1:1 classid 1:2 htb rate 102400kbps ceil 102400kbps tc class add dev eth0 parent 1:1 classid 1:3 htb rate 3kbps ceil 3kbps tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 22 0xffff flowid 1:2 The rules are on Machine A and Machine A is the one running the P2P applications (the traffic control + the P2P downloads are on the same machine). The machine only has a single NIC. After thinking about it, I believe that this will work fine and match ssh but only if the ssh traffic originates from Machine A (Machine A is the one connecting to another machine) but doesn't match if someone is ssh'ing to Machine A (which is what I'm trying to do). Any ideas? Thanks for your help. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --0-1316458810-1151609882=:16975 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit In regards to my earlier post, I believe that my problem is that the filter is not matching ssh traffic properly.  Here are the rules that I posted earlier, with the filter being the last one:

tc qdisc add dev eth0 root handle 1: htb default 3
tc class add dev eth0 parent 1: classid 1:1 htb rate 102400kbps ceil 102400kbps
tc class add dev eth0 parent 1:1 classid 1:2 htb rate 102400kbps ceil 102400kbps
tc class add dev eth0 parent 1:1 classid 1:3 htb rate 3kbps ceil 3kbps
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 22 0xffff flowid 1:2

The rules are on Machine A and Machine A is the one running the P2P applications (the traffic control + the P2P downloads are on the same machine).  The machine only has a single NIC.

After thinking about it, I believe that this will work fine and match ssh but only if the ssh traffic originates from Machine A (Machine A is the one connecting to another machine) but doesn't match if someone is ssh'ing to Machine A (which is what I'm trying to do).  Any ideas?  Thanks for your help.

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com --0-1316458810-1151609882=:16975-- --===============1835568224== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc --===============1835568224==--