Skrypt Robsona i QoS
|
jodlasty |
Dodano 17-03-2009 12:06
|
User
Posty: 9
Dołączył: 13/03/2009 11:24
|
Za pomocą skryptu zrobiłem limity na dowland.
Czy mogę go używać równolegle z QoS ustawiając wartości w Inbound Limit.
Czy jednak musi tam być wszystko poustawiane na NONE |
|
|
|
shibby |
Dodano 17-03-2009 12:10
|
SysOp
Posty: 17110
Dołączył: 15/01/2009 20:30
|
wszystko na 100%
w sumie to nie rozumiem czemu uzywac htb do downloadu a qos do uploadu, skoro mozna wszystko ustawic htb. duzo bardziej efastyczne i dajace wieksze mozliwosci niz qos.
Router: Unifi Cloud Gateway Max
Switch: Netgear MS510TXPP
Switch: Unifi USW-Flex-Mini - szt. 2
Wi-Fi: Unifi U6-Lite - szt. 2
Proxmox VE: i5-13400T, 64GB RAM, 2x 512GB NVMe, 3x 2TB SSD, Intel X710-DA2 SFP+
VM #1: Synology SA6400
VM #2: Debian, WWW
VM #3: Home Assistant OS
|
|
|
|
jodlasty |
Dodano 17-03-2009 13:27
|
User
Posty: 9
Dołączył: 13/03/2009 11:24
|
Czyli najlepiej wyłączyć QoS i wszystko ustawić za pomocą skryptu?
Szkoda tylko, że skrypt ma ograniczenie do 8Kbajtów |
|
|
|
shibby |
Dodano 17-03-2009 15:23
|
SysOp
Posty: 17110
Dołączył: 15/01/2009 20:30
|
a jaki problem wrzucic plik np do jffs a w firewallu go tylko odpalic.
Router: Unifi Cloud Gateway Max
Switch: Netgear MS510TXPP
Switch: Unifi USW-Flex-Mini - szt. 2
Wi-Fi: Unifi U6-Lite - szt. 2
Proxmox VE: i5-13400T, 64GB RAM, 2x 512GB NVMe, 3x 2TB SSD, Intel X710-DA2 SFP+
VM #1: Synology SA6400
VM #2: Debian, WWW
VM #3: Home Assistant OS
|
|
|
|
jodlasty |
Dodano 18-03-2009 12:29
|
User
Posty: 9
Dołączył: 13/03/2009 11:24
|
Cytat shibby napisał/a:
a jaki problem wrzucic plik np do jffs a w firewallu go tylko odpalic.
Czy ktoś znajdzie trochę czasu żeby napisać po koleji jak to zrobić. |
|
|
|
shibby |
Dodano 18-03-2009 16:16
|
SysOp
Posty: 17110
Dołączył: 15/01/2009 20:30
|
moze inaczej. wklej tu swoj firewall to ci go uszczuple tak by sie zmiescil w 8kB
Router: Unifi Cloud Gateway Max
Switch: Netgear MS510TXPP
Switch: Unifi USW-Flex-Mini - szt. 2
Wi-Fi: Unifi U6-Lite - szt. 2
Proxmox VE: i5-13400T, 64GB RAM, 2x 512GB NVMe, 3x 2TB SSD, Intel X710-DA2 SFP+
VM #1: Synology SA6400
VM #2: Debian, WWW
VM #3: Home Assistant OS
|
|
|
|
jodlasty |
Dodano 19-03-2009 11:15
|
User
Posty: 9
Dołączył: 13/03/2009 11:24
|
Cytat shibby napisał/a:
moze inaczej. wklej tu swoj firewall to ci go uszczuple tak by sie zmiescil w 8kB :)
#--------------------------------------------
#WRT54 Script Generator v1.02
#(C) 2006-2007 Robert "Robson" Mytkowski
#--------------------------------------------
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 2048kbit
$TCA parent 1:1 classid 1:10 htb rate 100kbit ceil 1700kbit prio 2
$TCA parent 1:1 classid 1:11 htb rate 100kbit ceil 1700kbit prio 2
$TCA parent 1:1 classid 1:12 htb rate 100kbit ceil 1700kbit prio 2
$TCA parent 1:1 classid 1:13 htb rate 100kbit ceil 1700kbit prio 2
$TCA parent 1:1 classid 1:14 htb rate 100kbit ceil 1700kbit prio 2
$TCA parent 1:1 classid 1:15 htb rate 100kbit ceil 1700kbit prio 2
$TCA parent 1:1 classid 1:16 htb rate 100kbit ceil 1700kbit prio 2
$TCA parent 1:1 classid 1:17 htb rate 100kbit ceil 1700kbit prio 2
$TCA parent 1:1 classid 1:18 htb rate 100kbit ceil 1700kbit prio 2
$TCA parent 1:1 classid 1:19 htb rate 100kbit ceil 1700kbit prio 2
$TCA parent 1:1 classid 1:20 htb rate 100kbit ceil 2048kbit prio 1
$TCA parent 1:1 classid 1:21 htb rate 100kbit ceil 1700kbit prio 2
$TCA parent 1:1 classid 1:22 htb rate 100kbit ceil 1700kbit prio 2
$TCA parent 1:1 classid 1:23 htb rate 100kbit ceil 1700kbit prio 2
$TCA parent 1:1 classid 1:24 htb rate 100kbit ceil 1700kbit prio 2
$TCA parent 1:1 classid 1:25 htb rate 100kbit ceil 1700kbit prio 2
$TCA parent 1:1 classid 1:26 htb rate 100kbit ceil 2048kbit prio 1
$TCA parent 1:1 classid 1:27 htb rate 248kbit ceil 2048kbit prio 2
$TCA parent 1:1 classid 1:28 htb rate 100kbit ceil 1700kbit prio 2
$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
$TQA parent 1:20 handle 20: $SFQ
$TQA parent 1:21 handle 21: $SFQ
$TQA parent 1:22 handle 22: $SFQ
$TQA parent 1:23 handle 23: $SFQ
$TQA parent 1:24 handle 24: $SFQ
$TQA parent 1:25 handle 25: $SFQ
$TQA parent 1:26 handle 26: $SFQ
$TQA parent 1:27 handle 27: $SFQ
$TQA parent 1:28 handle 28: $SFQ
$TFA parent 1:0 prio 2 protocol ip handle 10 fw flowid 1:10
$TFA parent 1:0 prio 2 protocol ip handle 11 fw flowid 1:11
$TFA parent 1:0 prio 2 protocol ip handle 12 fw flowid 1:12
$TFA parent 1:0 prio 2 protocol ip handle 13 fw flowid 1:13
$TFA parent 1:0 prio 2 protocol ip handle 14 fw flowid 1:14
$TFA parent 1:0 prio 2 protocol ip handle 15 fw flowid 1:15
$TFA parent 1:0 prio 2 protocol ip handle 16 fw flowid 1:16
$TFA parent 1:0 prio 2 protocol ip handle 17 fw flowid 1:17
$TFA parent 1:0 prio 2 protocol ip handle 18 fw flowid 1:18
$TFA parent 1:0 prio 2 protocol ip handle 19 fw flowid 1:19
$TFA parent 1:0 prio 1 protocol ip handle 20 fw flowid 1:20
$TFA parent 1:0 prio 2 protocol ip handle 21 fw flowid 1:21
$TFA parent 1:0 prio 2 protocol ip handle 22 fw flowid 1:22
$TFA parent 1:0 prio 2 protocol ip handle 23 fw flowid 1:23
$TFA parent 1:0 prio 2 protocol ip handle 24 fw flowid 1:24
$TFA parent 1:0 prio 2 protocol ip handle 25 fw flowid 1:25
$TFA parent 1:0 prio 1 protocol ip handle 26 fw flowid 1:26
$TFA parent 1:0 prio 2 protocol ip handle 27 fw flowid 1:27
$TFA parent 1:0 prio 2 protocol ip handle 28 fw flowid 1:28
iptables -t mangle -A POSTROUTING -d 192.168.2.3 -j MARK --set-mark 10
iptables -t mangle -A POSTROUTING -d 192.168.2.5 -j MARK --set-mark 11
iptables -t mangle -A POSTROUTING -d 192.168.2.6 -j MARK --set-mark 12
iptables -t mangle -A POSTROUTING -d 192.168.2.9 -j MARK --set-mark 13
iptables -t mangle -A POSTROUTING -d 192.168.2.10 -j MARK --set-mark 14
iptables -t mangle -A POSTROUTING -d 192.168.2.13 -j MARK --set-mark 15
iptables -t mangle -A POSTROUTING -d 192.168.2.14 -j MARK --set-mark 16
iptables -t mangle -A POSTROUTING -d 192.168.2.16 -j MARK --set-mark 17
iptables -t mangle -A POSTROUTING -d 192.168.2.17 -j MARK --set-mark 18
iptables -t mangle -A POSTROUTING -m iprange --dst-range 192.168.2.18-192.168.2.19 -j MARK --set-mark 19
iptables -t mangle -A POSTROUTING -d 192.168.2.22 -j MARK --set-mark 20
iptables -t mangle -A POSTROUTING -d 192.168.2.23 -j MARK --set-mark 21
iptables -t mangle -A POSTROUTING -d 192.168.2.29 -j MARK --set-mark 22
iptables -t mangle -A POSTROUTING -d 192.168.2.30 -j MARK --set-mark 23
iptables -t mangle -A POSTROUTING -d 192.168.2.33 -j MARK --set-mark 24
iptables -t mangle -A POSTROUTING -d 192.168.2.41 -j MARK --set-mark 25
iptables -t mangle -A POSTROUTING -m iprange --dst-range 192.168.2.87-192.168.2.88 -j MARK --set-mark 26
iptables -t mangle -A POSTROUTING -d 192.168.2.100 -j MARK --set-mark 27
iptables -t mangle -A POSTROUTING -d 192.168.2.164 -j MARK --set-mark 28
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 512kbit
$TCAU parent 1:1 classid 1:10 htb rate 24kbit ceil 450kbit prio 2
$TCAU parent 1:1 classid 1:11 htb rate 24kbit ceil 450kbit prio 2
$TCAU parent 1:1 classid 1:12 htb rate 24kbit ceil 450kbit prio 2
$TCAU parent 1:1 classid 1:13 htb rate 24kbit ceil 450kbit prio 2
$TCAU parent 1:1 classid 1:14 htb rate 24kbit ceil 450kbit prio 2
$TCAU parent 1:1 classid 1:15 htb rate 24kbit ceil 450kbit prio 2
$TCAU parent 1:1 classid 1:16 htb rate 24kbit ceil 450kbit prio 2
$TCAU parent 1:1 classid 1:17 htb rate 24kbit ceil 450kbit prio 2
$TCAU parent 1:1 classid 1:18 htb rate 24kbit ceil 450kbit prio 2
$TCAU parent 1:1 classid 1:19 htb rate 24kbit ceil 450kbit prio 2
$TCAU parent 1:1 classid 1:20 htb rate 24kbit ceil 512kbit prio 1
$TCAU parent 1:1 classid 1:21 htb rate 24kbit ceil 450kbit prio 2
$TCAU parent 1:1 classid 1:22 htb rate 24kbit ceil 450kbit prio 2
$TCAU parent 1:1 classid 1:23 htb rate 24kbit ceil 450kbit prio 2
$TCAU parent 1:1 classid 1:24 htb rate 24kbit ceil 450kbit prio 2
$TCAU parent 1:1 classid 1:25 htb rate 24kbit ceil 450kbit prio 2
$TCAU parent 1:1 classid 1:26 htb rate 24kbit ceil 512kbit prio 1
$TCAU parent 1:1 classid 1:27 htb rate 80kbit ceil 512kbit prio 2
$TCAU parent 1:1 classid 1:28 htb rate 24kbit ceil 450kbit 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
$TQAU parent 1:15 handle 15: $SFQ
$TQAU parent 1:16 handle 16: $SFQ
$TQAU parent 1:17 handle 17: $SFQ
$TQAU parent 1:18 handle 18: $SFQ
$TQAU parent 1:19 handle 19: $SFQ
$TQAU parent 1:20 handle 20: $SFQ
$TQAU parent 1:21 handle 21: $SFQ
$TQAU parent 1:22 handle 22: $SFQ
$TQAU parent 1:23 handle 23: $SFQ
$TQAU parent 1:24 handle 24: $SFQ
$TQAU parent 1:25 handle 25: $SFQ
$TQAU parent 1:26 handle 26: $SFQ
$TQAU parent 1:27 handle 27: $SFQ
$TQAU parent 1:28 handle 28: $SFQ
$TFAU parent 1:0 prio 2 protocol ip handle 10 fw flowid 1:10
$TFAU parent 1:0 prio 2 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 2 protocol ip handle 13 fw flowid 1:13
$TFAU parent 1:0 prio 2 protocol ip handle 14 fw flowid 1:14
$TFAU parent 1:0 prio 2 protocol ip handle 15 fw flowid 1:15
$TFAU parent 1:0 prio 2 protocol ip handle 16 fw flowid 1:16
$TFAU parent 1:0 prio 2 protocol ip handle 17 fw flowid 1:17
$TFAU parent 1:0 prio 2 protocol ip handle 18 fw flowid 1:18
$TFAU parent 1:0 prio 2 protocol ip handle 19 fw flowid 1:19
$TFAU parent 1:0 prio 1 protocol ip handle 20 fw flowid 1:20
$TFAU parent 1:0 prio 2 protocol ip handle 21 fw flowid 1:21
$TFAU parent 1:0 prio 2 protocol ip handle 22 fw flowid 1:22
$TFAU parent 1:0 prio 2 protocol ip handle 23 fw flowid 1:23
$TFAU parent 1:0 prio 2 protocol ip handle 24 fw flowid 1:24
$TFAU parent 1:0 prio 2 protocol ip handle 25 fw flowid 1:25
$TFAU parent 1:0 prio 1 protocol ip handle 26 fw flowid 1:26
$TFAU parent 1:0 prio 2 protocol ip handle 27 fw flowid 1:27
$TFAU parent 1:0 prio 2 protocol ip handle 28 fw flowid 1:28
iptables -t mangle -A PREROUTING -s 192.168.2.3 -j MARK --set-mark 10
iptables -t mangle -A PREROUTING -s 192.168.2.5 -j MARK --set-mark 11
iptables -t mangle -A PREROUTING -s 192.168.2.6 -j MARK --set-mark 12
iptables -t mangle -A PREROUTING -s 192.168.2.9 -j MARK --set-mark 13
iptables -t mangle -A PREROUTING -s 192.168.2.10 -j MARK --set-mark 14
iptables -t mangle -A PREROUTING -s 192.168.2.13 -j MARK --set-mark 15
iptables -t mangle -A PREROUTING -s 192.168.2.14 -j MARK --set-mark 16
iptables -t mangle -A PREROUTING -s 192.168.2.16 -j MARK --set-mark 17
iptables -t mangle -A PREROUTING -s 192.168.2.17 -j MARK --set-mark 18
iptables -t mangle -A PREROUTING -m iprange --src-range 192.168.2.18-192.168.2.19 -j MARK --set-mark 19
iptables -t mangle -A PREROUTING -s 192.168.2.22 -j MARK --set-mark 20
iptables -t mangle -A PREROUTING -s 192.168.2.23 -j MARK --set-mark 21
iptables -t mangle -A PREROUTING -s 192.168.2.29 -j MARK --set-mark 22
iptables -t mangle -A PREROUTING -s 192.168.2.30 -j MARK --set-mark 23
iptables -t mangle -A PREROUTING -s 192.168.2.33 -j MARK --set-mark 24
iptables -t mangle -A PREROUTING -s 192.168.2.41 -j MARK --set-mark 25
iptables -t mangle -A PREROUTING -m iprange --src-range 192.168.2.87-192.168.2.88 -j MARK --set-mark 26
iptables -t mangle -A PREROUTING -s 192.168.2.100 -j MARK --set-mark 27
iptables -t mangle -A PREROUTING -s 192.168.2.164 -j MARK --set-mark 28
iptables -t mangle -A PREROUTING -j IMQ --todev 0
iptables -I FORWARD -s 192.168.2.5 -p tcp -m connlimit --connlimit-above 150 -j DROP
iptables -I FORWARD -s 192.168.2.6 -p tcp -m connlimit --connlimit-above 150 -j DROP
iptables -I FORWARD -s 192.168.2.9 -p tcp -m connlimit --connlimit-above 150 -j DROP
iptables -I FORWARD -s 192.168.2.10 -p tcp -m connlimit --connlimit-above 150 -j DROP
iptables -I FORWARD -s 192.168.2.13 -p tcp -m connlimit --connlimit-above 150 -j DROP
iptables -I FORWARD -s 192.168.2.14 -p tcp -m connlimit --connlimit-above 150 -j DROP
iptables -I FORWARD -s 192.168.2.16 -p tcp -m connlimit --connlimit-above 150 -j DROP
iptables -I FORWARD -s 192.168.2.17 -p tcp -m connlimit --connlimit-above 150 -j DROP
iptables -I FORWARD -m iprange --src-range 192.168.2.18-192.168.2.19 -p tcp -m connlimit --connlimit-above 150 -j DROP
iptables -I FORWARD -s 192.168.2.23 -p tcp -m connlimit --connlimit-above 150 -j DROP
iptables -I FORWARD -s 192.168.2.29 -p tcp -m connlimit --connlimit-above 150 -j DROP
iptables -I FORWARD -s 192.168.2.30 -p tcp -m connlimit --connlimit-above 150 -j DROP
iptables -I FORWARD -s 192.168.2.33 -p tcp -m connlimit --connlimit-above 150 -j DROP
iptables -I FORWARD -s 192.168.2.41 -p tcp -m connlimit --connlimit-above 150 -j DROP
iptables -I FORWARD -s 192.168.2.164 -p tcp -m connlimit --connlimit-above 150 -j DROP |
|
|
|
shibby |
Dodano 19-03-2009 11:34
|
SysOp
Posty: 17110
Dołączył: 15/01/2009 20:30
|
pare zmian powinno wystarczyc.
w sumie nie wiem czy limitacja pakietow ci potrzebna. jak nie zmiesci ci sie firewall w 8kB to wywal regulki forward ... connlimit ...
sfq powinien zadbac by nikt nie zaoral pasma innym i sobie samemu
Cytat
TCA="tc class add dev br0 parent 1:1 classid"
TFA="tc filter add dev br0 parent 1:0 prio"
TQA="tc qdisc add dev br0"
SFQ="sfq perturb 10"
POST="iptables -t mangle -A POSTROUTING"
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 2048kbit
$TCA 1:10 htb rate 100kbit ceil 1700kbit prio 2
$TCA 1:11 htb rate 100kbit ceil 1700kbit prio 2
$TCA 1:12 htb rate 100kbit ceil 1700kbit prio 2
$TCA 1:13 htb rate 100kbit ceil 1700kbit prio 2
$TCA 1:14 htb rate 100kbit ceil 1700kbit prio 2
$TCA 1:15 htb rate 100kbit ceil 1700kbit prio 2
$TCA 1:16 htb rate 100kbit ceil 1700kbit prio 2
$TCA 1:17 htb rate 100kbit ceil 1700kbit prio 2
$TCA 1:18 htb rate 100kbit ceil 1700kbit prio 2
$TCA 1:19 htb rate 100kbit ceil 1700kbit prio 2
$TCA 1:20 htb rate 100kbit ceil 2048kbit prio 1
$TCA 1:21 htb rate 100kbit ceil 1700kbit prio 2
$TCA 1:22 htb rate 100kbit ceil 1700kbit prio 2
$TCA 1:23 htb rate 100kbit ceil 1700kbit prio 2
$TCA 1:24 htb rate 100kbit ceil 1700kbit prio 2
$TCA 1:25 htb rate 100kbit ceil 1700kbit prio 2
$TCA 1:26 htb rate 100kbit ceil 2048kbit prio 1
$TCA 1:27 htb rate 248kbit ceil 2048kbit prio 2
$TCA 1:28 htb rate 100kbit ceil 1700kbit prio 2
$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
$TQA parent 1:20 handle 20: $SFQ
$TQA parent 1:21 handle 21: $SFQ
$TQA parent 1:22 handle 22: $SFQ
$TQA parent 1:23 handle 23: $SFQ
$TQA parent 1:24 handle 24: $SFQ
$TQA parent 1:25 handle 25: $SFQ
$TQA parent 1:26 handle 26: $SFQ
$TQA parent 1:27 handle 27: $SFQ
$TQA parent 1:28 handle 28: $SFQ
$TFA 2 protocol ip handle 10 fw flowid 1:10
$TFA 2 protocol ip handle 11 fw flowid 1:11
$TFA 2 protocol ip handle 12 fw flowid 1:12
$TFA 2 protocol ip handle 13 fw flowid 1:13
$TFA 2 protocol ip handle 14 fw flowid 1:14
$TFA 2 protocol ip handle 15 fw flowid 1:15
$TFA 2 protocol ip handle 16 fw flowid 1:16
$TFA 2 protocol ip handle 17 fw flowid 1:17
$TFA 2 protocol ip handle 18 fw flowid 1:18
$TFA 2 protocol ip handle 19 fw flowid 1:19
$TFA 1 protocol ip handle 20 fw flowid 1:20
$TFA 2 protocol ip handle 21 fw flowid 1:21
$TFA 2 protocol ip handle 22 fw flowid 1:22
$TFA 2 protocol ip handle 23 fw flowid 1:23
$TFA 2 protocol ip handle 24 fw flowid 1:24
$TFA 2 protocol ip handle 25 fw flowid 1:25
$TFA 1 protocol ip handle 26 fw flowid 1:26
$TFA 2 protocol ip handle 27 fw flowid 1:27
$TFA 2 protocol ip handle 28 fw flowid 1:28
$POST -d 192.168.2.3 -j MARK --set-mark 10
$POST -d 192.168.2.5 -j MARK --set-mark 11
$POST -d 192.168.2.6 -j MARK --set-mark 12
$POST -d 192.168.2.9 -j MARK --set-mark 13
$POST -d 192.168.2.10 -j MARK --set-mark 14
$POST -d 192.168.2.13 -j MARK --set-mark 15
$POST -d 192.168.2.14 -j MARK --set-mark 16
$POST -d 192.168.2.16 -j MARK --set-mark 17
$POST -d 192.168.2.17 -j MARK --set-mark 18
$POST -m iprange --dst-range 192.168.2.18-192.168.2.19 -j MARK --set-mark 19
$POST -d 192.168.2.22 -j MARK --set-mark 20
$POST -d 192.168.2.23 -j MARK --set-mark 21
$POST -d 192.168.2.29 -j MARK --set-mark 22
$POST -d 192.168.2.30 -j MARK --set-mark 23
$POST -d 192.168.2.33 -j MARK --set-mark 24
$POST -d 192.168.2.41 -j MARK --set-mark 25
$POST -m iprange --dst-range 192.168.2.87-192.168.2.88 -j MARK --set-mark 26
$POST -d 192.168.2.100 -j MARK --set-mark 27
$POST -d 192.168.2.164 -j MARK --set-mark 28
TCAU="tc class add dev imq0 parent 2:1 classid"
TFAU="tc filter add dev imq0 parent 2:0 prio"
TQAU="tc qdisc add dev imq0"
PRE="iptables -t mangle -A PREROUTING"
modprobe imq
modprobe ipt_IMQ
ip link set imq0 up
tc qdisc del dev imq0 root
tc qdisc add dev imq0 root handle 2: htb
tc class add dev imq0 parent 1: classid 2:1 htb rate 512kbit
$TCAU 2:10 htb rate 24kbit ceil 450kbit prio 2
$TCAU 2:11 htb rate 24kbit ceil 450kbit prio 2
$TCAU 2:12 htb rate 24kbit ceil 450kbit prio 2
$TCAU 2:13 htb rate 24kbit ceil 450kbit prio 2
$TCAU 2:14 htb rate 24kbit ceil 450kbit prio 2
$TCAU 2:15 htb rate 24kbit ceil 450kbit prio 2
$TCAU 2:16 htb rate 24kbit ceil 450kbit prio 2
$TCAU 2:17 htb rate 24kbit ceil 450kbit prio 2
$TCAU 2:18 htb rate 24kbit ceil 450kbit prio 2
$TCAU 2:19 htb rate 24kbit ceil 450kbit prio 2
$TCAU 2:20 htb rate 24kbit ceil 512kbit prio 1
$TCAU 2:21 htb rate 24kbit ceil 450kbit prio 2
$TCAU 2:22 htb rate 24kbit ceil 450kbit prio 2
$TCAU 2:23 htb rate 24kbit ceil 450kbit prio 2
$TCAU 2:24 htb rate 24kbit ceil 450kbit prio 2
$TCAU 2:25 htb rate 24kbit ceil 450kbit prio 2
$TCAU 2:26 htb rate 24kbit ceil 512kbit prio 1
$TCAU 2:27 htb rate 80kbit ceil 512kbit prio 2
$TCAU 2:28 htb rate 24kbit ceil 450kbit prio 2
$TQAU parent 2:10 handle 10: $SFQ
$TQAU parent 2:11 handle 11: $SFQ
$TQAU parent 2:12 handle 12: $SFQ
$TQAU parent 2:13 handle 13: $SFQ
$TQAU parent 2:14 handle 14: $SFQ
$TQAU parent 2:15 handle 15: $SFQ
$TQAU parent 2:16 handle 16: $SFQ
$TQAU parent 2:17 handle 17: $SFQ
$TQAU parent 2:18 handle 18: $SFQ
$TQAU parent 2:19 handle 19: $SFQ
$TQAU parent 2:20 handle 20: $SFQ
$TQAU parent 2:21 handle 21: $SFQ
$TQAU parent 2:22 handle 22: $SFQ
$TQAU parent 2:23 handle 23: $SFQ
$TQAU parent 2:24 handle 24: $SFQ
$TQAU parent 2:25 handle 25: $SFQ
$TQAU parent 2:26 handle 26: $SFQ
$TQAU parent 2:27 handle 27: $SFQ
$TQAU parent 2:28 handle 28: $SFQ
$TFAU 2 protocol ip handle 10 fw flowid 2:10
$TFAU 2 protocol ip handle 11 fw flowid 2:11
$TFAU 2 protocol ip handle 12 fw flowid 2:12
$TFAU 2 protocol ip handle 13 fw flowid 2:13
$TFAU 2 protocol ip handle 14 fw flowid 2:14
$TFAU 2 protocol ip handle 15 fw flowid 2:15
$TFAU 2 protocol ip handle 16 fw flowid 2:16
$TFAU 2 protocol ip handle 17 fw flowid 2:17
$TFAU 2 protocol ip handle 18 fw flowid 2:18
$TFAU 2 protocol ip handle 19 fw flowid 2:19
$TFAU 1 protocol ip handle 20 fw flowid 2:20
$TFAU 2 protocol ip handle 21 fw flowid 2:21
$TFAU 2 protocol ip handle 22 fw flowid 2:22
$TFAU 2 protocol ip handle 23 fw flowid 2:23
$TFAU 2 protocol ip handle 24 fw flowid 2:24
$TFAU 2 protocol ip handle 25 fw flowid 2:25
$TFAU 1 protocol ip handle 26 fw flowid 2:26
$TFAU 2 protocol ip handle 27 fw flowid 2:27
$TFAU 2 protocol ip handle 28 fw flowid 2:28
$PRE -s 192.168.2.3 -j MARK --set-mark 10
$PRE -s 192.168.2.5 -j MARK --set-mark 11
$PRE -s 192.168.2.6 -j MARK --set-mark 12
$PRE -s 192.168.2.9 -j MARK --set-mark 13
$PRE -s 192.168.2.10 -j MARK --set-mark 14
$PRE -s 192.168.2.13 -j MARK --set-mark 15
$PRE -s 192.168.2.14 -j MARK --set-mark 16
$PRE -s 192.168.2.16 -j MARK --set-mark 17
$PRE -s 192.168.2.17 -j MARK --set-mark 18
$PRE -m iprange --src-range 192.168.2.18-192.168.2.19 -j MARK --set-mark 19
$PRE -s 192.168.2.22 -j MARK --set-mark 20
$PRE -s 192.168.2.23 -j MARK --set-mark 21
$PRE -s 192.168.2.29 -j MARK --set-mark 22
$PRE -s 192.168.2.30 -j MARK --set-mark 23
$PRE -s 192.168.2.33 -j MARK --set-mark 24
$PRE -s 192.168.2.41 -j MARK --set-mark 25
$PRE -m iprange --src-range 192.168.2.87-192.168.2.88 -j MARK --set-mark 26
$PRE -s 192.168.2.100 -j MARK --set-mark 27
$PRE -s 192.168.2.164 -j MARK --set-mark 28
$PRE -j IMQ --todev 0
FORW="iptables -I FORWARD"
$FORW -s 192.168.2.5 -p tcp -m connlimit --connlimit-above 150 -j DROP
$FORW -s 192.168.2.6 -p tcp -m connlimit --connlimit-above 150 -j DROP
$FORW -s 192.168.2.9 -p tcp -m connlimit --connlimit-above 150 -j DROP
$FORW -s 192.168.2.10 -p tcp -m connlimit --connlimit-above 150 -j DROP
$FORW -s 192.168.2.13 -p tcp -m connlimit --connlimit-above 150 -j DROP
$FORW -s 192.168.2.14 -p tcp -m connlimit --connlimit-above 150 -j DROP
$FORW -s 192.168.2.16 -p tcp -m connlimit --connlimit-above 150 -j DROP
$FORW -s 192.168.2.17 -p tcp -m connlimit --connlimit-above 150 -j DROP
$FORW -m iprange --src-range 192.168.2.18-192.168.2.19 -p tcp -m connlimit --connlimit-above 150 -j DROP
$FORW -s 192.168.2.23 -p tcp -m connlimit --connlimit-above 150 -j DROP
$FORW -s 192.168.2.29 -p tcp -m connlimit --connlimit-above 150 -j DROP
$FORW -s 192.168.2.30 -p tcp -m connlimit --connlimit-above 150 -j DROP
$FORW -s 192.168.2.33 -p tcp -m connlimit --connlimit-above 150 -j DROP
$FORW -s 192.168.2.41 -p tcp -m connlimit --connlimit-above 150 -j DROP
$FORW -s 192.168.2.164 -p tcp -m connlimit --connlimit-above 150 -j DROP
Router: Unifi Cloud Gateway Max
Switch: Netgear MS510TXPP
Switch: Unifi USW-Flex-Mini - szt. 2
Wi-Fi: Unifi U6-Lite - szt. 2
Proxmox VE: i5-13400T, 64GB RAM, 2x 512GB NVMe, 3x 2TB SSD, Intel X710-DA2 SFP+
VM #1: Synology SA6400
VM #2: Debian, WWW
VM #3: Home Assistant OS
|
|
|
|
jodlasty |
Dodano 19-03-2009 13:21
|
User
Posty: 9
Dołączył: 13/03/2009 11:24
|
Bardzo dziękuję shibby
Nie zmieścił się to wyrzuciłem
FORW="iptables -I FORWARD"
$FORW -s 192.168.2.5 -p tcp -m connlimit --connlimit-above 150 -j DROP
$FORW -s 192.168.2.6 -p tcp -m connlimit --connlimit-above 150 -j DROP
$FORW -s 192.168.2.9 -p tcp -m connlimit --connlimit-above 150 -j DROP
$FORW -s 192.168.2.10 -p tcp -m connlimit --connlimit-above 150 -j DROP
$FORW -s 192.168.2.13 -p tcp -m connlimit --connlimit-above 150 -j DROP
$FORW -s 192.168.2.14 -p tcp -m connlimit --connlimit-above 150 -j DROP
$FORW -s 192.168.2.16 -p tcp -m connlimit --connlimit-above 150 -j DROP
$FORW -s 192.168.2.17 -p tcp -m connlimit --connlimit-above 150 -j DROP
$FORW -m iprange --src-range 192.168.2.18-192.168.2.19 -p tcp -m connlimit --connlimit-above 150 -j DROP
$FORW -s 192.168.2.23 -p tcp -m connlimit --connlimit-above 150 -j DROP
$FORW -s 192.168.2.29 -p tcp -m connlimit --connlimit-above 150 -j DROP
$FORW -s 192.168.2.30 -p tcp -m connlimit --connlimit-above 150 -j DROP
$FORW -s 192.168.2.33 -p tcp -m connlimit --connlimit-above 150 -j DROP
$FORW -s 192.168.2.41 -p tcp -m connlimit --connlimit-above 150 -j DROP
$FORW -s 192.168.2.164 -p tcp -m connlimit --connlimit-above 150 -j DROP
Dobrze zrobiłem tak?
|
|
|
|
shibby |
Dodano 19-03-2009 16:54
|
SysOp
Posty: 17110
Dołączył: 15/01/2009 20:30
|
tak.
Router: Unifi Cloud Gateway Max
Switch: Netgear MS510TXPP
Switch: Unifi USW-Flex-Mini - szt. 2
Wi-Fi: Unifi U6-Lite - szt. 2
Proxmox VE: i5-13400T, 64GB RAM, 2x 512GB NVMe, 3x 2TB SSD, Intel X710-DA2 SFP+
VM #1: Synology SA6400
VM #2: Debian, WWW
VM #3: Home Assistant OS
|
|
|