Readme and traffic-limit.sh improvements

This commit is contained in:
Christoph Wiechert
2017-04-25 21:54:10 +02:00
parent 3e31051f54
commit 2b79d0b337
3 changed files with 51 additions and 20 deletions

View File

@@ -1,18 +0,0 @@
#!/bin/bash
# http://www.codeoriented.com/how-to-limit-network-bandwidth-for-a-specific-tcp-port-on-ubuntu-linux/
IF=$2
BAND=$1
PORT=$3
if [ -z "$3" ] ; then
echo $0 10kbps wlan0 8080
exit 1
fi
tc qdisc del root dev $IF
tc qdisc add dev $IF root handle 1:0 htb default 10
tc class add dev $IF parent 1:0 classid 1:10 htb rate $BAND prio 0
tc filter add dev $IF parent 1:0 prio 0 protocol ip u32 match ip protocol 4 0xff match ip dport $PORT 0xffff flowid 1:10
tc qdisc show dev $IF