Temat: iptables tl-wr1043nd
Witam, wygenerowałem sobie skrypt za pomocą WRT54 Script Generator z myślą że zmienię kilka wartości i wszystko będzie działać ale niestety trochę mnie to przerosło... Skrypt dodaje w luci do Firewall -> Custom Rules. Na początek zmieniłem wpisy br0 na eth0 (nie wiem czy to jest poprawne) i to była w sumie cała moja modyfikacja
Może ktoś go poprawić żeby wszystko zaczęło działać?
#--------------------------------------------
#WRT54 Script Generator v1.02
#(C) 2006-2007 Robert "Robson" Mytkowski
#--------------------------------------------
TCA="tc class add dev eth0"
TFA="tc filter add dev eth"
TQA="tc qdisc add dev eth0"
SFQ="sfq perturb 10"
tc qdisc del dev eth0 root
tc qdisc add dev eth0 root handle 1: htb
tc class add dev eth0 parent 1: classid 1:1 htb rate 19000kbit
$TCA parent 1:1 classid 1:10 htb rate 13000kbit ceil 19000kbit prio 0
$TCA parent 1:1 classid 1:11 htb rate 4000kbit ceil 15000kbit prio 2
$TCA parent 1:1 classid 1:12 htb rate 1900kbit ceil 15000kbit prio 2
$TCA parent 1:1 classid 1:13 htb rate 100kbit ceil 5000kbit prio 4
$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
$TFA parent 1:0 prio 0 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 4 protocol ip handle 13 fw flowid 1:13
iptables -t mangle -A POSTROUTING -d 192.168.1.2 -j MARK --set-mark 10
iptables -t mangle -A POSTROUTING -d 192.168.1.3 -j MARK --set-mark 11
iptables -t mangle -A POSTROUTING -d 192.168.1.7 -j MARK --set-mark 12
iptables -t mangle -A POSTROUTING -m iprange --dst-range 192.168.1.8-192.168.1.250 -j MARK --set-mark 13
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 1050kbit
$TCAU parent 1:1 classid 1:10 htb rate 800kbit ceil 1050kbit prio 0
$TCAU parent 1:1 classid 1:11 htb rate 100kbit ceil 500kbit prio 2
$TCAU parent 1:1 classid 1:12 htb rate 130kbit ceil 700kbit prio 2
$TCAU parent 1:1 classid 1:13 htb rate 20kbit ceil 200kbit prio 4
$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
$TFAU parent 1:0 prio 0 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 4 protocol ip handle 13 fw flowid 1:13
iptables -t mangle -A PREROUTING -s 192.168.1.2 -j MARK --set-mark 10
iptables -t mangle -A PREROUTING -s 192.168.1.3 -j MARK --set-mark 11
iptables -t mangle -A PREROUTING -s 192.168.1.7 -j MARK --set-mark 12
iptables -t mangle -A PREROUTING -m iprange --src-range 192.168.1.8-192.168.1.250 -j MARK --set-mark 13
iptables -t mangle -A PREROUTING -j IMQ --todev 0