#!/bin/bash
# change these values to suit your needs
ETHERNET_DEVICE="eth0"
LINK_SPEED="1000Mbit"
UPLOAD_SPEED="50Mbit"
PORT="80"

# delete previous root node
tc qdisc del dev $ETHERNET_DEVICE root
# create root node
tc qdisc add dev $ETHERNET_DEVICE root handle 1: htb default 11
# create LINK class
tc class add dev $ETHERNET_DEVICE parent 1: classid 1:1 htb rate $LINK_SPEED
# create our HTTP shaping class
tc class add dev $ETHERNET_DEVICE parent 1:1 classid 1:10 htb rate $UPLOAD_SPEED
# create our REST class for unutilized bandwidth
tc class add dev $ETHERNET_DEVICE parent 1:1 classid 1:11 htb rate $LINK_SPEED
# create the filter for the HTTP class, we filter on source port 80 (http)
tc filter add dev $ETHERNET_DEVICE protocol ip parent 1:0 prio 1 u32 match ip sport $PORT 0xffff flowid 1:10

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 linux988 的頭像
    linux988

    Linux Fedora CentOS Ubuntu RedHat Alex

    linux988 發表在 痞客邦 留言(0) 人氣()