A więc tak czas w routerze:
Cytat Mon, 29 Mar 2010 23:23:58 +0200
mój skrypt w firewoll:
Cytat if [ $(date +%H) -gt 11 ]; then
TCA="tc class add dev br0"
TFA="tc filter add dev br0"
TQA="tc qdisc add dev br0"
SFQ="sfq perturb 10"
tc qdisc del dev br0 root
tc qdisc add dev br0 root handle 1: htb default 19
tc class add dev br0 parent 1: classid 1:1 htb rate 2000kbit
$TCA parent 1:1 classid 1:10 htb rate 350kbit ceil 900kbit prio 0
$TCA parent 1:1 classid 1:11 htb rate 70kbit ceil 500kbit prio 1
$TCA parent 1:1 classid 1:12 htb rate 70kbit ceil 500kbit prio 1
$TCA parent 1:1 classid 1:13 htb rate 400kbit ceil 1800kbit prio 2
$TCA parent 1:1 classid 1:14 htb rate 300kbit ceil 1600kbit prio 2
$TCA parent 1:1 classid 1:15 htb rate 400kbit ceil 1700kbit prio 2
$TCA parent 1:1 classid 1:16 htb rate 350kbit ceil 1700kbit prio 2
$TCA parent 1:1 classid 1:17 htb rate 1kbit ceil 400kbit prio 6
$TCA parent 1:1 classid 1:18 htb rate 5kbit ceil 400kbit prio 1
$TCA parent 1:1 classid 1:19 htb rate 1kbit ceil 1000kbit prio 6
$TQA parent 1:10 handle 10: $SFQ
$TQA parent 1:11 handle 11: $SFQ
$TQA parent 1:12 handle 12: $SFQ
$TQA parent 1:13 handle 13: $SFQ
$TQA parent 1:14 handle 14: $SFQ
$TQA parent 1:15 handle 15: $SFQ
$TQA parent 1:16 handle 16: $SFQ
$TQA parent 1:17 handle 17: $SFQ
$TQA parent 1:18 handle 18: $SFQ
$TQA parent 1:19 handle 19: $SFQ
$TFA protocol ip parent 1:0 u32 match ip dst 192.168.1.2/32 flowid 1:10
$TFA protocol ip parent 1:0 u32 match ip dst 192.168.1.3/32 flowid 1:11
$TFA protocol ip parent 1:0 u32 match ip dst 192.168.1.4/32 flowid 1:12
$TFA protocol ip parent 1:0 u32 match ip dst 192.168.1.5/32 flowid 1:13
$TFA protocol ip parent 1:0 u32 match ip dst 192.168.1.6/32 flowid 1:14
$TFA protocol ip parent 1:0 u32 match ip dst 192.168.1.7/32 flowid 1:15
$TFA protocol ip parent 1:0 u32 match ip dst 192.168.1.8/32 flowid 1:16
$TFA protocol ip parent 1:0 u32 match ip dst 192.168.1.9/32 flowid 1:17
$TFA protocol ip parent 1:0 u32 match ip dst 192.168.1.11/32 flowid 1:18
TCAU="tc class add dev imq0"
TFAU="tc filter add dev imq0"
TQAU="tc qdisc add dev imq0"
SFQ="sfq perturb 10"
modprobe imq
modprobe ipt_IMQ
ip link set imq0 up
tc qdisc del dev imq0 root
tc qdisc add dev imq0 root handle 1: htb
tc class add dev imq0 parent 1: classid 1:1 htb rate 350kbit
$TCAU parent 1:1 classid 1:10 htb rate 220kbit ceil 300kbit prio 0
$TCAU parent 1:1 classid 1:11 htb rate 2kbit ceil 10kbit prio 1
$TCAU parent 1:1 classid 1:12 htb rate 20kbit ceil 300kbit prio 2
$TCAU parent 1:1 classid 1:13 htb rate 1kbit ceil 10kbit prio 4
$TCAU parent 1:1 classid 1:14 htb rate 1kbit ceil 100kbit prio 2
$TQAU parent 1:10 handle 10: $SFQ
$TQAU parent 1:11 handle 11: $SFQ
$TQAU parent 1:12 handle 12: $SFQ
$TQAU parent 1:13 handle 13: $SFQ
$TQAU parent 1:14 handle 14: $SFQ
$TFAU parent 1:0 prio 0 protocol ip handle 10 fw flowid 1:10
$TFAU parent 1:0 prio 1 protocol ip handle 11 fw flowid 1:11
$TFAU parent 1:0 prio 2 protocol ip handle 12 fw flowid 1:12
$TFAU parent 1:0 prio 4 protocol ip handle 13 fw flowid 1:13
$TFAU parent 1:0 prio 2 protocol ip handle 14 fw flowid 1:14
iptables -t mangle -A PREROUTING -s 192.168.1.2 -j MARK --set-mark 10
iptables -t mangle -A PREROUTING -m iprange --src-range 192.168.1.3-192.168.1.4 -j MARK --set-mark 11
iptables -t mangle -A PREROUTING -m iprange --src-range 192.168.1.5-192.168.1.8 -j MARK --set-mark 12
iptables -t mangle -A PREROUTING -s 192.168.1.9 -j MARK --set-mark 13
iptables -t mangle -A PREROUTING -s 192.168.1.10 -j MARK --set-mark 14
iptables -t mangle -A PREROUTING -j IMQ --todev 0
fi
pomimo że nie mam jeszcze 24 skrypt nie jest uruchomiony
restartowałem router kilkukrotnie przy różnych godzinach
|