linux-admin.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Unterkircher <unki@netshadow.at>
To: admin <linux-admin@vger.kernel.org>
Cc: urgrue <urgrue@tumsan.fi>
Subject: Re: traffic shaping with tc
Date: Wed, 23 Feb 2005 18:30:23 +0100	[thread overview]
Message-ID: <421CBDAF.40900@netshadow.at> (raw)
In-Reply-To: <20050223085859.GA24948@fede2.dev.ascom.fi>

does this mean you have an 100mbit connection (200*512) or the complete 
user-traffic from your LAN to internet should not be much more then 
512kbit? :)

if all your clients are for example on the same network (ex. 
172.16.0.0/16), you can make this with tcng like this:

#include "fields.tc"
#include "ports.tc"

dev eth0 {
        egress {
                class ( <$only512> )    if ip_src == 172.16.0.0;

                htb () {
                        class ( rate 768kbps, ceil 768kbps ) {
                                $only512 = class ( rate 512kbps, ceil 
512kbps ) { sfq; } ;
                        }
                }
        }
}

the tc rules:

tc qdisc del dev eth0 root

# ================================ Device eth0 
================================

tc qdisc add dev eth0 handle 1:0 root dsmark indices 2 default_index 0
tc qdisc add dev eth0 handle 2:0 parent 1:0 htb
tc class add dev eth0 parent 2:0 classid 2:1 htb rate 96000bps ceil 96000bps
tc class add dev eth0 parent 2:1 classid 2:2 htb rate 64000bps ceil 64000bps
tc qdisc add dev eth0 handle 3:0 parent 2:2 sfq
tc filter add dev eth0 parent 2:0 protocol all prio 1 tcindex mask 0x1 
shift 0
tc filter add dev eth0 parent 2:0 protocol all prio 1 handle 1 tcindex 
classid 2:2
tc filter add dev eth0 parent 1:0 protocol all prio 1 u32 match u32 
0xac100000 0xffffffff at 12 classid 1:1







urgrue wrote:

> is there some neat way to restrict each user to a certain amount of 
> bandwidth? instead of the usual setup of restricting them all to a 
> certain _shared_ bandwidth?
> for example, i have 200 users on my network and i want _each_ to get 
> only 512kbps.
> in my limited understanding of tc this would normally mean creating 
> 200 queues of 512kbps and piping each individual IP to its own queue.
> isnt there some saner way to do this?
> -
> To unsubscribe from this list: send the line "unsubscribe linux-admin" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

      reply	other threads:[~2005-02-23 17:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-23  8:58 traffic shaping with tc urgrue
2005-02-23 17:30 ` Andreas Unterkircher [this message]

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=421CBDAF.40900@netshadow.at \
    --to=unki@netshadow.at \
    --cc=linux-admin@vger.kernel.org \
    --cc=urgrue@tumsan.fi \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).