Limiting bandwidth on one port

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Everyone

I'm new to tc.  I'm trying to speed limit access to SSH/SFTP on my
external interface (eth0) without affecting any other traffic on any of
the other interfaces.

I've attached a script with my tc commands in.  Can someone point me in
the right direction?

Thank you for your help in advance.
Tim

- --
If you wish to be happy for one hour, get drunk.
If you wish to be happy for three days, get married.
If you wish to be happy for a month, kill your pig and eat it.
If you with to be happy forever, learn to fish.
        -- Chinese Proverb


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iQEVAwUBQlEO2PXjnG6MF3+4AQKCwwgA10hxw+BwzIcUdBS549Twfs8luXD7cGLx
GrN4c8rIjbz/g64CBRv/0FQNamNB+n2qJkHw36LpknyjKY4+kYvcovMQposYeVuj
g/BD7qRa502GIOWMJxbjlGStxwcg2V2pTR+nXy/HNvQsQXGpwYMJ10qGVLlxyF0U
QjcVbry4XpflDGbmpilfJOsNETcfUHC2yxCku1JDIvr6sQ7KPzg5Pyi1HHC1dHt6
qkKTQ0sRuICNhIuuVbj9NaHVd7F7DHWxzINiT0dTIslWz/IzbVLAoLDuaVGTetRA
w3rCZEw2Yv+ryjWYih+9hHheVTZSFt3z5uAekZW3ZVICE1fMmqI6ug==
=tiz/
-----END PGP SIGNATURE-----
#!/bin/sh

### Basics 

DEV=eth0
IP=192.168.1.4

LINERATE=2mbit
LOWRATE=8kbps

TC=/sbin/tc


### Rules - throttle SSH on ext_int

$TC qdisc del dev $DEV root

$TC qdisc add dev $DEV root handle 1: cbq avpkt 1000 bandwidth $LINERATE
$TC qdisc add dev $DEV parent 1: classid 1:1 cbq rate $LOWRATE allow 1500 prio 5 bounded isolated

$TC filter add dev $DEV parent 1: protocol ip prio 16 u32 match ip sport 22 0xFFFF flowid 1:1
_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux