Re: [LARTC] Luser seeks tc syntax clue

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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=192.168.1.0/24
RATE=220kbit
LIMIT=10000
BURST=22000

# 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



[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux