[linux-support] Bandbreite limitierung

Thomas Deutsch thomas_mailinglisten at tuxpeople.org
Wed Apr 14 15:18:26 CEST 2004


Thomas Deutsch schrieb:
> Ich habe hier ein kleines Script gefunden:
> http://plone.vizzzion.org/linux_server/qos/view#Listing%201

Und habe es mal angepasst. Folgendes Script sollte nun folgendes machen:

- Der Traffic darf nie grösser sein als 10Mbit
- SSH darf zwischen 7 und 8 Mbit sein (Ist unrealistisch, ich weiss)
- Der Rest des Traffic (Web, FTP etc.) darf zwischen 5 und 6 Mbit 
schnell sein.

Habe ich das Script richtig gemacht?

mfg

Thomas


- - - - - SCRIPT - - - - -

#!/bin/sh

## Root
/sbin/tc qdisc add dev ppp0 root handle 1:0 htb default 12

## Hauptklasse
/sbin/tc class add dev ppp0 parent 1:0 classid 1:1 htb \
                                  rate 10Mbit ceil 10Mbit
## Klasse fuer VPN/SSH
/sbin/tc class add dev ppp0 parent 1:1 classid 1:11 htb \
                                  rate 7Mbit ceil 8Mbit prio 1
## Klasse fuer normalen Traffic
/sbin/tc class add dev ppp0 parent 1:1 classid 1:12 htb \
                                  rate 5Mbit ceil 6Mbit prio 2
# SSH
iptables -A POSTROUTING -t mangle -o ppp0 -p tcp --dport 22 \
                            -j MARK --set-mark 11

tc filter add dev ppp0 parent 1:0 prio 0 protocol ip \
                            handle 10 fw flowid 1:10
tc filter add dev ppp0 parent 1:0 prio 0 protocol ip \
                            handle 11 fw flowid 1:11
tc filter add dev ppp0 parent 1:0 prio 0 protocol ip \
                            handle 13 fw flowid


More information about the Linux-support mailing list