All of lore.kernel.org
 help / color / mirror / Atom feed
From: Trevor Warren <trevorwarren@softhome.net>
To: lartc@vger.kernel.org
Subject: [LARTC] herz the script that i have done.
Date: Sat, 14 Jun 2003 23:58:31 +0000	[thread overview]
Message-ID: <marc-lartc-105567787128739@msgid-missing> (raw)

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

Hello there,

 Having made quite a lot of expensive mistakes i have finally clobbered
together a script for the users on my network.

 Have a look at it and please suggest as to how can i limit bandwidth to
each ip on this network to about 64Kbits.

Trevor



-- 
( >-    GNU/LINUX, It's all about CHOICE      -< )
/~\    __  trevor@clovertechnologies.com  __   /~\
|  \) /  Pre Sales Consultant - Red Hat     \ (/ |
|_|_  \    9820349221(M) | 22881326(O)      / _|_|
       \___________________________________/

[-- Attachment #2: final.sh --]
[-- Type: text/x-sh, Size: 13509 bytes --]

#!/bin/bash
                                                                                                                                              
#####################################
#Deleting and setting up
#Root qdisc's
#####################################
tc qdisc del dev eth0 root
tc qdisc add dev eth0 root handle 1:0 cbq bandwidth 1Mbit avpkt 1000 cell 8

#######################################
#Setting up top 2 qdiscs
#for initial packet classification
#######################################
# Exatt Rules
#######################################

tc class add dev eth0 parent 1:0 classid 1:1 cbq bandwidth 1Mbit rate 800kbit weight 80kbit allot 1514 cell 8 maxburst 20 avpkt 1000 isolated
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.10.0/24 classid 1:1
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.10.0/24 classid 1:1
                                                                         
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.11.0/24 classid 1:1
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.11.0/24 classid 1:1

tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.12.0/24 classid 1:1
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.12.0/24 classid 1:1

tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.13.0/24 classid 1:1
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.13.0/24 classid 1:1

tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.14.0/24 classid 1:1
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.14.0/24 classid 1:1

tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.15.0/24 classid 1:1
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.15.0/24 classid 1:1

tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.16.0/24 classid 1:1
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.16.0/24 classid 1:1

tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.17.0/24 classid 1:1
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.17.0/24 classid 1:1

tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.18.0/24 classid 1:1
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.18.0/24 classid 1:1

tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.19.0/24 classid 1:1
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.19.0/24 classid 1:1


##########################################
#Paradyne Rules
##########################################                                                                     
tc class add dev eth0 parent 1:0 classid 1:2 cbq bandwidth 1Mbit rate 200kbit weight 20kbit allot 1514 cell 8 maxburst 20 avpkt 1000 bounded
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.20.0/24 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.20.0/24 classid 1:2

tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.21.0/24 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.21.0/24 classid 1:2

tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.22.0/24 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.22.0/24 classid 1:2

tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.23.0/24 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.23.0/24 classid 1:2

tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.24.0/24 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.24.0/24 classid 1:2

tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.25.0/24 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.25.0/24 classid 1:2

tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.26.0/24 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.26.0/24 classid 1:2

tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.27.0/24 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.27.0/24 classid 1:2

tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.28.0/24 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.28.0/24 classid 1:2

tc filter add dev eth0 parent 1:0 protocol ip u32 match ip src 192.168.29.0/24 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst 192.168.29.0/24 classid 1:2

                                                                                                                                              
#######################################
#Setting up top 10 qdiscs
#for initial Exatt packet classification
#######################################
tc class add dev eth0 parent 1:1 classid 1:3 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded isolated
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip src 192.168.10.0/24 classid 1:3
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip dst 192.168.10.0/24 classid 1:3
                                                                                                                                              
tc class add dev eth0 parent 1:1 classid 1:4 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded isolated
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip src 192.168.11.0/24 classid 1:4
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip dst 192.168.11.0/24 classid 1:4                                                                                
tc class add dev eth0 parent 1:1 classid 1:5 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded isolated
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip src 192.168.12.0/24 classid 1:5
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip dst 192.168.12.0/24 classid 1:5
                                                                                                                                              
tc class add dev eth0 parent 1:1 classid 1:6 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded isolated
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip src 192.168.13.0/24 classid 1:6
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip dst 192.168.13.0/24 classid 1:6
                                                                                                                                              
tc class add dev eth0 parent 1:1 classid 1:7 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded isolated  
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip src 192.168.14.0/24 classid 1:7
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip dst 192.168.14.0/24 classid 1:7
                                                                                                                                              
tc class add dev eth0 parent 1:1 classid 1:8 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded isolated
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip src 192.168.15.0/24 classid 1:8
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip dst 192.168.15.0/24 classid 1:8

tc class add dev eth0 parent 1:1 classid 1:9 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded isolated 
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip src 192.168.16.0/24 classid 1:9
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip dst 192.168.16.0/24 classid 1:9
                                                                                                                                              
tc class add dev eth0 parent 1:1 classid 1:10 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded isolated
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip src 192.168.17.0/24 classid 1:10
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip dst 192.168.17.0/24 classid 1:10
                                                                                                                                              
tc class add dev eth0 parent 1:1 classid 1:11 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded isolated 
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip src 192.168.18.0/24 classid 1:11
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip dst 192.168.18.0/24 classid 1:11
                                                                                                                                              
tc class add dev eth0 parent 1:1 classid 1:12 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded isolated 
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip src 192.168.19.0/24 classid 1:12
tc filter add dev eth0 parent 1:1 protocol ip u32 match ip dst 192.168.19.0/24 classid 1:12
                                 

######################################
#Setting up top 10 qdiscs
#for initial Paradyne packet classification
#######################################
tc class add dev eth0 parent 1:2 classid 1:13 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded 
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip src 192.168.20.0/24 classid 1:13
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip dst 192.168.20.0/24 classid 1:13
                                                                                                             
tc class add dev eth0 parent 1:2 classid 1:14 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip src 192.168.21.0/24 classid 1:14
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip dst 192.168.21.0/24 classid 1:14
                                                                                                                                             
tc class add dev eth0 parent 1:2 classid 1:15 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip src 192.168.22.0/24 classid 1:15
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip dst 192.168.22.0/24 classid 1:15

tc class add dev eth0 parent 1:2 classid 1:16 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip src 192.168.23.0/24 classid 1:16
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip dst 192.168.23.0/24 classid 1:16

tc class add dev eth0 parent 1:2 classid 1:17 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip src 192.168.24.0/24 classid 1:17
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip dst 192.168.24.0/24 classid 1:17

tc class add dev eth0 parent 1:2 classid 1:18 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip src 192.168.25.0/24 classid 1:18
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip dst 192.168.25.0/24 classid 1:18

tc class add dev eth0 parent 1:2 classid 1:19 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip src 192.168.26.0/24 classid 1:19
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip dst 192.168.26.0/24 classid 1:19

tc class add dev eth0 parent 1:2 classid 1:20 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip src 192.168.27.0/24 classid 1:20
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip dst 192.168.27.0/24 classid 1:20

tc class add dev eth0 parent 1:2 classid 1:21 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip src 192.168.28.0/24 classid 1:21
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip dst 192.168.28.0/24 classid 1:21

tc class add dev eth0 parent 1:2 classid 1:22 cbq bandwidth 1Mbit rate 80Kbit allot 1514 cell 8 maxburst 20 avpkt 1000 weight 8Kbit bounded
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip src 192.168.29.0/24 classid 1:22
tc filter add dev eth0 parent 1:2 protocol ip u32 match ip dst 192.168.29.0/24 classid 1:22

                                                                                                                                              
#################################
# Start of Actual Filters
#################################
                                                                                                                                              


             reply	other threads:[~2003-06-14 23:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-14 23:58 Trevor Warren [this message]
2003-06-15  6:39 ` [LARTC] herz the script that i have done Trevor Warren
2003-06-15 17:56 ` Stef Coene
2003-06-15 18:59 ` Stef Coene
2003-06-15 19:20 ` Trevor Warren
2003-06-15 20:01 ` Trevor Warren
2003-06-15 20:58 ` Trevor Warren
2003-06-16  7:28 ` Stef Coene
2003-06-16  8:22 ` Stef Coene
2003-06-16  9:52 ` Stef Coene
2003-06-16 15:39 ` Trevor Warren
2003-06-17  0:35 ` Trevor Warren
2003-06-17 17:36 ` Stef Coene
2003-06-18 20:19 ` Trevor Warren

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-105567787128739@msgid-missing \
    --to=trevorwarren@softhome.net \
    --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.