All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Gavin" <gavin@raha.com>
To: lartc@vger.kernel.org
Subject: [LARTC] CBQ by IP address
Date: Sat, 16 Mar 2002 11:45:27 +0000	[thread overview]
Message-ID: <marc-lartc-101627919613412@msgid-missing> (raw)

[-- Attachment #1: Type: text/plain, Size: 893 bytes --]

Hello,

I have a Q running (script attached, from the how-to) which does the
following:

1. Assign 6MBit to link
2. Assign 5MBit to 192.168.230.0/24
3. Assign 3MBit to 192.168.220.0/24

I have two questions:

1. Is it possible to set a limit for a particular IP address, rather than a
range?  I've tried  the following:

match ip src 192.168.230.1    -    the filter has no effect on traffic
match ip src 192.168.230.4/32 - the filter has no effect on traffic
match ip src 192.168.230.1/24 - the filter affects the whole 192.168.230.0
network

2. With the attached script, bandwidth is set to 5MBit or 3Mbit for a single
machine on the filtered networks.  When I add another machine on the same
network, both machines get half of the rate.  Is there a way to say that all
machines on a particular /24 are limited to a particular rate, rather than
sharing it between them?

Many thanks,

Gavin

[-- Attachment #2: 5.3.bounded.txt --]
[-- Type: text/plain, Size: 1575 bytes --]

#!/bin/bash
#Test script
# One class, bounded at 6Mbit.  Two classes, bounded, 3Mbit and 5Mbit, not sharing extra.

#Delete the existing eth0 root qdisc
tc qdisc del dev eth0 root

#Add root qdisc
tc qdisc add dev eth0 root handle 1:0 cbq bandwidth 100Mbit avpkt 1000 cell 8

#Add 1:0 class, with 6Mbit limit
tc class add dev eth0 parent 1:0 classid 1:1 cbq bandwidth 100Mbit rate 6Mbit weight 0.6Mbit prio 8 allot 1514 
cell 8 maxburst 20 avpkt 1000 bounded

#Add first class, limited to 5Mbit
tc class add dev eth0 parent 1:1 classid 1:3 cbq bandwidth 100Mbit rate 5Mbit weight 0.5Mbit prio 5 allot 1514 
cell 8 maxburst 20 avpkt 1000 bounded

#Add second class, limited to 3Mbit

tc class add dev eth0 parent 1:1 classid 1:4 cbq bandwidth 100Mbit  rate 3Mbit weight 0.3Mbit prio 5 allot 1514
 cell 8 maxburst 20 avpkt 1000 bounded

#Add qdisc for class 1:3
tc qdisc add dev eth0 parent 1:3 handle 30: sfq

#Add qdisc for class 1:4
tc qdisc add dev eth0 parent 1:4 handle 40: sfq

#Add filter for 192.168.230.0
tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match ip src 192.168.230.0/24 flowid 1:3
#tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match ip src 192.168.230.1 flowid 1:3
#tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match ip src 192.168.230.1/24 flowid 1:3
#tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match ip src 192.168.230.1/32 flowid 1:3

#Add filter for 192.168.220.0
tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match ip src 192.168.220.0/24 flowid 1:4



             reply	other threads:[~2002-03-16 11:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-16 11:45 Gavin [this message]
2002-03-16 16:24 ` [LARTC] CBQ by IP address Stef Coene

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=marc-lartc-101627919613412@msgid-missing \
    --to=gavin@raha.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.