#!/bin/bash
# change these values to suit your needs
ETHERNET_DEVICE="eth0"
LINK_SPEED="1000Mbit"
UPLOAD_SPEED="50Mbit"
PORT="80"
tc qdisc del dev ETHERNET_DEVICE root
tc qdisc add dev ETHERNET_DEVICE root handle 1: htb default 11
tc class add dev ETHERNET_DEVICE parent 1: classid 1:1 htb rate LINK_SPEED
tc class add dev ETHERNET_DEVICE parent 1:1 classid 1:10 htb rate UPLOAD_SPEED
tc class add dev ETHERNET_DEVICE parent 1:1 classid 1:11 htb rate LINK_SPEED
tc filter add dev ETHERNET_DEVICE protocol ip parent 1:0 prio 1 u32 match ip sport PORT 0xffff flowid 1:10
- 2月 02 週一 200909:55
Linux 用 tc 控制頻寬
# delete previous root node
# create root node
# create LINK class
# create our HTTP shaping class
# create our REST class for unutilized bandwidth
# create the filter for the HTTP class, we filter on source port 80 (http)
文章標籤
全站熱搜
