Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Using Variables for Bandwidth control Post 302237982 by Smiling Dragon on Thursday 18th of September 2008 09:33:10 PM
Old 09-18-2008
Unfortunately, that's a bit of a difficult requirment to understand...
You've listed that the example of Bandwidth CIR Upload and Bandwidth PIR Upload is 5kb/s and 16kb/s but the example code seems to show 11 and 32 instead.

What I suggest you do is to list all the variables you need the script to automatically pick, give them names that will be clear to the reader but are still valid names (for example, I would call a variable that contains the Bandwidth CIR Upload "bandwidthCIRUpload").

Then change the places in your script where the variables need ot be used to the variable name preceded by a $ symbol and surrounded by {}.
eg, if your script has a line:
Code:
${TC} class add dev eth1 parent 1:1 classid 1:30 htb rate 32kbit ceil 96kbit

and you want to have the '1:1', '32', and '64' be calculated automatically, change it to:
Code:
${TC} class add dev eth1 parent ${parent} classid 1:30 htb rate ${bandwidthCIRDownload}kbit ceil ${bandwidthPIRDownload}kbit

Once you have that done, report back here with your modified code and your list of variables.
Make sure to surround your code in [ C O D E ] tags so it is easier to read.
eg
[ C O D E ]
my code here
[ / C O D E ]
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

bandwidth check?

I'm on T1, is there any way i can check my acctual bandwidth? Thank you all (3 Replies)
Discussion started by: solvman
3 Replies

2. IP Networking

Bandwidth Caping With PF

i have two questions actually... i need to block certain ports with openbsd and PF in a large lan, the firewall is supposed to be a router between the internet and the first lan switch. first of all, would this work at all in theory? second, i tried doing this a few days ago at a huge lan but i... (2 Replies)
Discussion started by: nocturnal
2 Replies

3. IP Networking

Bandwidth Regulation

Hello, I was wondering how one would go about regulating bandwidth of a server running RH Linux 8.0 and Apache. I am running a webserver, and want only one person to be able to download one file at a time. So, they can't click about 10 files and soak up lots of bandwidth. Plus, I would like to cap... (2 Replies)
Discussion started by: Phobos
2 Replies

4. IP Networking

bandwidth

Hi, 1-What is bandewidth ? 2-How to calculate ? 3-How to measure ? Any free software to measure it ? Many thanks. (4 Replies)
Discussion started by: big123456
4 Replies

5. IP Networking

Bandwidth montor

Hi all I have been running iptraf on a linux box for a few months monitoring bandwidth utilization realtime from mac address with port mirroring. Now I want to graph these bandwidth utilization. Is MRTG the right software? Any ideas? (4 Replies)
Discussion started by: palm101
4 Replies

6. Shell Programming and Scripting

control click variables

I want to be able to control click (Mac) and be able to select from a context menu...run file....and have it dynamically run based on the control click. How do I get the control click absolute path of the filename? Are there different variables like directory, fullpath, extention? (0 Replies)
Discussion started by: mainegate
0 Replies

7. IP Networking

802 QOS/ Bandwidth Control

My question is such: I want to control the bandwidth of my users and cap there speed on the network. I was told by a Cisco rep that it is better to police or control the bandwidth at the switch and not via the router. It that the correct place to control bandwidth at the switch or would it be... (0 Replies)
Discussion started by: metallica1973
0 Replies

8. UNIX for Dummies Questions & Answers

For loop control with two variables in csh shell

Hi All How can i control for loop with two different variables in csh shell Regards Nikhil (1 Reply)
Discussion started by: Nikhilindurkar
1 Replies

9. Shell Programming and Scripting

control variables...

Hi. I´ve a question to a running script: i=0 #fill an Array with all files in a folder ending with .sys for Par in *.sys ; do Par2="$Par" ; i=$((i... (1 Reply)
Discussion started by: Lock3
1 Replies

10. Shell Programming and Scripting

Reading control characters into variables

Hi, I am trying to write a shell script to help with some digital signature work currently being undertaken where we have a file that contains a number of rows ending with ^M. What I need to do is concatenate this using shell scripting and retain the control character. E.G. abc^M... (5 Replies)
Discussion started by: chris01010
5 Replies
Match-all classifier in tc(8)                                          Linux                                         Match-all classifier in tc(8)

NAME
matchall - traffic control filter that matches every packet SYNOPSIS
tc filter ... matchall [ skip_sw | skip_hw ] [ action ACTION_SPEC ] [ classid CLASSID ] DESCRIPTION
The matchall filter allows to classify every packet that flows on the port and run a action on it. OPTIONS
action ACTION_SPEC Apply an action from the generic actions framework on matching packets. classid CLASSID Push matching packets into the class identified by CLASSID. skip_sw Do not process filter by software. If hardware has no offload support for this filter, or TC offload is not enabled for the inter- face, operation will fail. skip_hw Do not process filter by hardware. EXAMPLES
To create ingress mirroring from port eth1 to port eth2: tc qdisc add dev eth1 handle ffff: ingress tc filter add dev eth1 parent ffff: matchall skip_sw action mirred egress mirror dev eth2 The first command creats an ingress qdisc with handle ffff: on device eth1 where the second command attaches a matchall filters on it that mirrors the packets to device eth2. To create egress mirroring from port eth1 to port eth2: tc qdisc add dev eth1 handle 1: root prio tc filter add dev eth1 parent 1: matchall skip_sw action mirred egress mirror dev eth2 The first command creats an egress qdisc with handle 1: that replaces the root qdisc on device eth1 where the second command attaches a matchall filters on it that mirrors the packets to device eth2. To sample one of every 100 packets flowing into interface eth0 to psample group 12: tc qdisc add dev eth0 handle ffff: ingress tc filter add dev eth0 parent ffff: matchall action sample rate 100 group 12 SEE ALSO
tc(8), iproute2 21 Oct 2015 Match-all classifier in tc(8)
All times are GMT -4. The time now is 03:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy