Witam
Mam tomato 1.07 i dotychczas korzystałem ze skryptu
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
tc class add dev br0 parent 1: classid 1:1 htb rate 10225kbit
$TCA parent 1:1 classid 1:10 htb rate 1250kbit ceil 5592kbit prio 1
$TCA parent 1:1 classid 1:11 htb rate 2550kbit ceil 9550kbit prio 1
$TQA parent 1:10 handle 10: $SFQ
$TQA parent 1:11 handle 11: $SFQ
$TFA parent 1:0 prio 1 protocol ip handle 10 fw flowid 1:10
$TFA parent 1:0 prio 1 protocol ip handle 11 fw flowid 1:11
iptables -t mangle -A POSTROUTING -m iprange --dst-range 192.168.1.8-192.168.1.19 -j MARK --set-mark 10
iptables -t mangle -A POSTROUTING -m iprange --dst-range 192.168.1.105-192.168.1.105 -j MARK --set-mark 10
iptables -t mangle -A POSTROUTING -m iprange --dst-range 192.168.1.20-192.168.1.30 -j MARK --set-mark 11
TCAU="tc class add dev imq0"
TFAU="tc filter add dev imq0"
TQAU="tc qdisc add dev imq0"
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 660kbit
$TCAU parent 1:1 classid 1:10 htb rate 64kbit ceil 296kbit prio 2
$TCAU parent 1:1 classid 1:11 htb rate 112kbit ceil 620kbit prio 1
$TQAU parent 1:10 handle 10: $SFQ
$TQAU parent 1:11 handle 11: $SFQ
$TFAU parent 1:0 prio 2 protocol ip handle 10 fw flowid 1:10
$TFAU parent 1:0 prio 1 protocol ip handle 11 fw flowid 1:11
iptables -t mangle -A PREROUTING -m iprange --src-range 192.168.1.5-192.168.1.19 -j MARK --set-mark 10
iptables -t mangle -A PREROUTING -m iprange --src-range 192.168.1.105-192.168.1.105 -j MARK --set-mark 10
iptables -t mangle -A PREROUTING -m iprange --src-range 192.168.1.20-192.168.1.30 -j MARK --set-mark 11
iptables -t mangle -A PREROUTING -j IMQ --todev 0
iptables -I FORWARD -m iprange --src-range 192.168.1.5-192.168.1.19 -p tcp -m connlimit --connlimit-above 620 -j DROP
iptables -I FORWARD -m iprange --src-range 192.168.1.5-192.168.1.19 -p udp -m limit --limit 50/sec -j DROP
powyższy działa ok ale jest problem gdyz jest to podzial na podsieci a w podsieciach zdarza się systuacja ze jeden user drugiemu zajmie cale łącze . Napisalem nowy skrypt z podziałem na userów ale on mi nie dziala mozecie sprawdzic co z nim nie tak bo mi juz sie pomysły skończyły (problem jest taki ze są lokalne połączenia a nie ma neta na tych kompach.
#--------------------------------------------
#WRT54 v3
#--------------------------------------------
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
tc class add dev br0 parent 1: classid 1:1 htb rate 7000kbit
$TCA parent 1:1 classid 1:10 htb rate 4480kbit ceil 5604kbit prio 2 #WIFI_LAN 1024 (2x5123x1120)
$TCA parent 1:1 classid 1:11 htb rate 4480kbit ceil 7000kbit prio 2 #HOME 4*1120
$TCA parent 1:10 classid 1:101 htb rate 1120kbit ceil 5504kbit prio 2 #NatRouter
$TCA parent 1:10 classid 1:102 htb rate 1120kbit ceil 5504kbit prio 2 #NatRouter
$TCA parent 1:10 classid 1:103 htb rate 1120kbit ceil 5504kbit prio 2 #Jan
$TCA parent 1:10 classid 1:104 htb rate 512kbit ceil 5504kbit prio 2 #wifi_usb
$TCA parent 1:10 classid 1:105 htb rate 512kbit ceil 5504kbit prio 2 #NoteWiFi
$TCA parent 1:10 classid 1:106 htb rate 512kbit ceil 5504kbit prio 2 #LAN_INNE
$TCA parent 1:11 classid 1:111 htb rate 1120kbit ceil 6600kbit prio 2 #_admin
$TCA parent 1:11 classid 1:112 htb rate 1120kbit ceil 6600kbit prio 2 #lan_acer_WIFI
$TCA parent 1:11 classid 1:113 htb rate 1120kbit ceil 6600kbit prio 2 #Toshiba_lan_WIFI
$TCA parent 1:11 classid 1:114 htb rate 1120kbit ceil 6600kbit prio 2 #WIFI_HP_WIFI
$TCA parent 1:11 classid 1:115 htb rate 1120kbit ceil 5504kbit prio 2 #HOME_inne
$TQA parent 1:101 handle 101: $SFQ
$TQA parent 1:102 handle 102: $SFQ
$TQA parent 1:103 handle 103: $SFQ
$TQA parent 1:104 handle 104: $SFQ
$TQA parent 1:105 handle 105: $SFQ
$TQA parent 1:106 handle 106: $SFQ
$TQA parent 1:111 handle 111: $SFQ
$TQA parent 1:112 handle 112: $SFQ
$TQA parent 1:113 handle 113: $SFQ
$TQA parent 1:114 handle 114: $SFQ
$TQA parent 1:115 handle 115: $SFQ
$TFA parent 1:0 prio 2 protocol ip handle 10 fw flowid 1:101
$TFA parent 1:0 prio 2 protocol ip handle 11 fw flowid 1:102
$TFA parent 1:0 prio 2 protocol ip handle 12 fw flowid 1:103
$TFA parent 1:0 prio 2 protocol ip handle 13 fw flowid 1:104
$TFA parent 1:0 prio 2 protocol ip handle 14 fw flowid 1:105
$TFA parent 1:0 prio 2 protocol ip handle 15 fw flowid 1:106
$TFA parent 1:0 prio 2 protocol ip handle 16 fw flowid 1:111
$TFA parent 1:0 prio 2 protocol ip handle 17 fw flowid 1:112
$TFA parent 1:0 prio 2 protocol ip handle 18 fw flowid 1:113
$TFA parent 1:0 prio 2 protocol ip handle 19 fw flowid 1:114
$TFA parent 1:0 prio 2 protocol ip handle 20 fw flowid 1:115
iptables -t mangle -A POSTROUTING -d 192.168.1.9 -j MARK --set-mark 10
iptables -t mangle -A POSTROUTING -d 192.168.1.10 -j MARK --set-mark 11
iptables -t mangle -A POSTROUTING -d 192.168.1.11 -j MARK --set-mark 12
iptables -t mangle -A POSTROUTING -d 192.168.1.12 -j MARK --set-mark 13
iptables -t mangle -A POSTROUTING -d 192.168.1.13 -j MARK --set-mark 14
iptables -t mangle -A POSTROUTING -m iprange --dst-range 192.168.1.14-192.168.1.19 -j MARK --set-mark 15
iptables -t mangle -A POSTROUTING -d 192.168.1.20 -j MARK --set-mark 16
iptables -t mangle -A POSTROUTING -m iprange --dst-range 192.168.1.21-192.168.1.22 -j MARK --set-mark 17
iptables -t mangle -A POSTROUTING -m iprange --dst-range 192.168.1.23-192.168.1.25 -j MARK --set-mark 18
iptables -t mangle -A POSTROUTING -m iprange --dst-range 192.168.1.26-192.168.1.27 -j MARK --set-mark 19
iptables -t mangle -A POSTROUTING -m iprange --dst-range 192.168.1.28-192.168.1.30 -j MARK --set-mark 20
TCAU="tc class add dev imq0"
TFAU="tc filter add dev imq0"
TQAU="tc qdisc add dev imq0"
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 660kbit
$TCAU parent 1:1 classid 1:10 htb rate 288kbit ceil 312kbit prio 2
$TCAU parent 1:1 classid 1:11 htb rate 312kbit ceil 620kbit prio 2
$TCAU parent 1:10 classid 1:101 htb rate 72kbit ceil 312kbit prio 2
$TCAU parent 1:10 classid 1:102 htb rate 72kbit ceil 312kbit prio 2
$TCAU parent 1:10 classid 1:103 htb rate 72kbit ceil 312kbit prio 2
$TCAU parent 1:10 classid 1:104 htb rate 32kbit ceil 288kbit prio 2
$TCAU parent 1:10 classid 1:105 htb rate 40kbit ceil 312kbit prio 2
$TCAU parent 1:10 classid 1:106 htb rate 48kbit ceil 288kbit prio 2
$TCAU parent 1:11 classid 1:111 htb rate 78kbit ceil 600kbit prio 2
$TCAU parent 1:11 classid 1:112 htb rate 78kbit ceil 600kbit prio 2
$TCAU parent 1:11 classid 1:113 htb rate 78kbit ceil 620kbit prio 2
$TCAU parent 1:11 classid 1:114 htb rate 78kbit ceil 600kbit prio 2
$TCAU parent 1:11 classid 1:115 htb rate 64kbit ceil 480kbit prio 2
$TQAU parent 1:101 handle 101: $SFQ
$TQAU parent 1:102 handle 102: $SFQ
$TQAU parent 1:103 handle 103: $SFQ
$TQAU parent 1:104 handle 104: $SFQ
$TQAU parent 1:105 handle 105: $SFQ
$TQAU parent 1:106 handle 106: $SFQ
$TQAU parent 1:111 handle 111: $SFQ
$TQAU parent 1:112 handle 112: $SFQ
$TQAU parent 1:113 handle 113: $SFQ
$TQAU parent 1:114 handle 114: $SFQ
$TQAU parent 1:115 handle 115: $SFQ
$TFAU parent 1:0 prio 2 protocol ip handle 10 fw flowid 1:101
$TFAU parent 1:0 prio 2 protocol ip handle 11 fw flowid 1:102
$TFAU parent 1:0 prio 2 protocol ip handle 12 fw flowid 1:103
$TFAU parent 1:0 prio 2 protocol ip handle 13 fw flowid 1:104
$TFAU parent 1:0 prio 2 protocol ip handle 14 fw flowid 1:105
$TFAU parent 1:0 prio 2 protocol ip handle 15 fw flowid 1:106
$TFAU parent 1:0 prio 2 protocol ip handle 16 fw flowid 1:111
$TFAU parent 1:0 prio 2 protocol ip handle 17 fw flowid 1:112
$TFAU parent 1:0 prio 2 protocol ip handle 18 fw flowid 1:113
$TFAU parent 1:0 prio 2 protocol ip handle 19 fw flowid 1:114
$TFAU parent 1:0 prio 2 protocol ip handle 20 fw flowid 1:115
iptables -t mangle -A PREROUTING ! -d 192.168.1.0/24 -s 192.168.1.9 -j MARK --set-mark 10
iptables -t mangle -A PREROUTING ! -d 192.168.1.0/24 -s 192.168.1.10 -j MARK --set-mark 11
iptables -t mangle -A PREROUTING ! -d 192.168.1.0/24 -s 192.168.1.11 -j MARK --set-mark 12
iptables -t mangle -A PREROUTING ! -d 192.168.1.0/24 -s 192.168.1.12 -j MARK --set-mark 13
iptables -t mangle -A PREROUTING ! -d 192.168.1.0/24 -s 192.168.1.13 -j MARK --set-mark 14
iptables -t mangle -A PREROUTING ! -d 192.168.1.0/24 -m iprange --src-range 192.168.1.14-192.168.1.19 -j MARK --set-mark 15
iptables -t mangle -A PREROUTING ! -d 192.168.1.0/24 -s 192.168.1.20 -j MARK --set-mark 16
iptables -t mangle -A PREROUTING ! -d 192.168.1.0/24 -m iprange --src-range 192.168.1.21-192.168.1.22 -j MARK --set-mark 17
iptables -t mangle -A PREROUTING ! -d 192.168.1.0/24 -m iprange --src-range 192.168.1.23-192.168.1.25 -j MARK --set-mark 18
iptables -t mangle -A PREROUTING ! -d 192.168.1.0/24 -m iprange --src-range 192.168.1.26-192.168.1.27 -j MARK --set-mark 19
iptables -t mangle -A PREROUTING ! -d 192.168.1.0/24 -m iprange --src-range 192.168.1.28-192.168.1.30 -j MARK --set-mark 20
iptables -t mangle -A PREROUTING -j IMQ --todev 0
ip link set imq1 up
iptables -t mangle -A POSTROUTING -d 192.168.1.9 -j IMQ --todev 1
ip link set imq3 up
iptables -t mangle -A POSTROUTING -d 192.168.1.10 -j IMQ --todev 3
ip link set imq5 up
iptables -t mangle -A POSTROUTING -d 192.168.1.11 -j IMQ --todev 5
ip link set imq7 up
iptables -t mangle -A POSTROUTING -m iprange --dst-range 192.168.1.12-192.168.1.13 -j IMQ --todev 7
ip link set imq9 up
iptables -t mangle -A POSTROUTING -m iprange --dst-range 192.168.1.14-192.168.1.19 -j IMQ --todev 9
ip link set imq11 up
iptables -t mangle -A POSTROUTING -d 192.168.1.20 ! -s 192.168.1.1 -j IMQ --todev 11
ip link set imq13 up
iptables -t mangle -A POSTROUTING -m iprange --dst-range 192.168.1.21-192.168.1.22 -j IMQ --todev 13
ip link set imq15 up
iptables -t mangle -A POSTROUTING -m iprange --dst-range 192.168.1.23-192.168.1.25 -j IMQ --todev 15
ip link set imq17 up
iptables -t mangle -A POSTROUTING -m iprange --dst-range 192.168.1.26-192.168.1.27 -j IMQ --todev 17
ip link set imq19 up
iptables -t mangle -A POSTROUTING -m iprange --dst-range 192.168.1.28-192.168.1.30 -j IMQ --todev 19
================================
DIR-320 > DD-WRT v24-sp2 (10/10/09)mini-usb-ftp
Asus rt-n16 1.28.0000 MIPSR2-105 K26 USB AIO
|