Linux Advanced Routing and Traffic Control list
 help / color / mirror / Atom feed
From: Richard Lamont <richard@lamont.me.uk>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] Luser seeks tc syntax clue
Date: Tue, 05 Aug 2003 22:54:48 +0000	[thread overview]
Message-ID: <marc-lartc-106012415114530@msgid-missing> (raw)
In-Reply-To: <marc-lartc-106011060731604@msgid-missing>

On Tuesday 05 August 2003 23:09, Steffen Moser wrote:

> I am not an expert within "tc", so some other user most probably will
> correct me...

Well, it works! That's expert enough for me.

Many, many thanks.

In case anyone else wants the corrected script, or wants to
suggest improvements, here it is:

-------------------------------8<------------------------------
#!/bin/bash
#
# Traffic shaping script

DEV=eth0
LAN\x192.168.1.0/24
RATE"0kbit
LIMIT\x10000
BURST"000

# Clear out old settings
tc qdisc del dev $DEV root
tc qdisc del dev $DEV ingress

# Create root qdisc
tc qdisc add dev $DEV root handle 1: prio

# Stuff addressed to LAN goes straight through
tc qdisc add dev $DEV parent 1:1 handle 10: pfifo

# Stuff addressed to big wide world gets shaped
tc qdisc add dev $DEV parent 1:2 handle 20: tbf limit $LIMIT burst $BURST rate $RATE

# Filter on LAN destination address
tc filter add dev $DEV parent 1: protocol ip prio 10 u32 match ip dst $LAN flowid 1:1

# Default filter for everything else
tc filter add dev $DEV parent 1: protocol ip prio 15 u32 match ip dst 0.0.0.0/0 flowid 1:2

-------------------------------8<------------------------------



-- 

Richard Lamont

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

      parent reply	other threads:[~2003-08-05 22:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-05 19:05 [LARTC] Luser seeks tc syntax clue Richard Lamont
2003-08-05 22:09 ` Steffen Moser
2003-08-05 22:54 ` Richard Lamont [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=marc-lartc-106012415114530@msgid-missing \
    --to=richard@lamont.me.uk \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox