TC Filter Debian

auamanu

Kabelverknoter(in)
Hallo,

ich stehe gerade vor einem Problem bei folgendem Befehl:

"tc filter add dev eth1 parent ffff: protocol ip prio 111 u32 match u32 0 0 flowid :1 action ipt -j MARK --set-mark 20 action continue > /dev/null"

Dieser ist Teil eines Scripts zur Bandbreitenkontrolle.

Führe ich diesen aus bekomme ich folgende Ausgabe:

bad action type ipt
Usage: ... gact <ACTION> [RAND] [INDEX]
Where: ACTION := reclassify | drop | continue | pass
RAND := random <RANDTYPE> <ACTION> <VAL>
RANDTYPE := netrand | determ
VAL : = value not exceeding 10000
INDEX := index value used

bad action parsing
parse_action: bad value (7:ipt)!
Illegal "action"

Er kann wohl die action "ipt" nicht verarbeiten, bisher habe ich im Internet nur gefunden das es wohl bei älteren "iproute" Paketen zu diesem Problem kommen kann. Leider habe ich keine Ahnung wie ich hier eine ggf. neuere Version drauf bekommen könnte und ob ich mir damit nicht gleich alles zerlege.

Es handelt sich um Debian Wheezy 7.8 mit Kernel 3.4.108+ auf armv7l´.

Hat eventuell jemand eine Idee wie ich das zum laufen bekommen könnte?
 
Leider nein :(

bad action type iptables
Usage: ... gact <ACTION> [RAND] [INDEX]
Where: ACTION := reclassify | drop | continue | pass
RAND := random <RANDTYPE> <ACTION> <VAL>
RANDTYPE := netrand | determ
VAL : = value not exceeding 10000
INDEX := index value used

bad action parsing
parse_action: bad value (7:iptables)!
Illegal "action"
 
Hm, mir fällt gerade nicht auf Anhieb ein, wo der Fehler liegen könnte. Ich hänge dir mal den Trafficshaping-Teil meines iptables-Skripts an, vielleicht hilft dir das weiter?

Code:
#$wan ist das Interface zum Internet hin
tc qdisc del dev $wan root

# maximaler Upstream in kbit
CEIL=6000

# Bandbreite im HTB-Tree aufteilen, nicht zugewiesener Traffic wird Class 15 zugewiesen
tc qdisc add dev $wan root handle 1: htb default 15

# Definieren des HTB-Trees
tc class add dev $wan parent 1: classid 1:1 htb rate ${CEIL}kbit ceil ${CEIL}kbit

# hoechste Prio fuer interaktiven Traffic (SSH, IRC und SYN-geflaggte Pakete, Traffic der Clients)
# (min 2000kbit garantiert, max $CEIL moeglich, minimale Verzoegerung)
tc class add dev $wan parent 1:1 classid 1:10 htb rate 2000kbit ceil ${CEIL}kbit prio 1

# Prio 2 - Traffic von / zum Fileserver, maximaler Durchsatz
# (min 80kbit garantiert, max $CEIL moeglich)
tc class add dev $wan parent 1:1 classid 1:11 htb rate 1000kbit ceil ${CEIL}kbit prio 2
tc qdisc add dev $wan parent 1:10 handle 120: sfq perturb 10
tc qdisc add dev $wan parent 1:11 handle 130: sfq perturb 10

# Klassifizieren des Traffics
tc filter add dev $wan parent 1:0 protocol ip prio 1 handle 1 fw classid 1:10
tc filter add dev $wan parent 1:0 protocol ip prio 2 handle 2 fw classid 1:11

# Markieren des Traffics
# Prio 1: interaktiver Traffic, Traffic der Clients
iptables -t mangle -A PREROUTING -p tcp --dport 22 -j MARK --set-mark 0x1
iptables -t mangle -A PREROUTING -p tcp --sport 22 -j MARK --set-mark 0x1
iptables -t mangle -A PREROUTING -p tcp --sport 22 -j RETURN
iptables -t mangle -A PREROUTING -p tcp --dport 6667 -j MARK --set-mark 0x1
iptables -t mangle -A PREROUTING -p tcp --dport 6668 -j MARK --set-mark 0x1
iptables -t mangle -A PREROUTING -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -j MARK --set-mark 0x1
iptables -t mangle -A PREROUTING -s 10.0.0.4 -j MARK --set-mark 0x1
iptables -t mangle -A PREROUTING -d 10.0.0.4 -j MARK --set-mark 0x1
iptables -t mangle -A PREROUTING -s 10.0.0.10 -j MARK --set-mark 0x1
iptables -t mangle -A PREROUTING -d 10.0.0.10 -j MARK --set-mark 0x1
iptables -t mangle -A PREROUTING -m tos --tos Minimize-Delay -j MARK --set-mark 0x1

## Prio 2: Traffic von / zu Apollon
iptables -t mangle -A PREROUTING -s 10.0.0.1 -j MARK --set-mark 0x2
iptables -t mangle -A PREROUTING -d 10.0.0.1 -j MARK --set-mark 0x2
iptables -t mangle -A PREROUTING -m tos --tos Maximize-Throughput -j MARK --set-mark 0x2

Das Skript arbeitete unter Gentoo und ich glaube auch unter Debian, aber das ist schon etwas her.

MfG Jimini
 
Zurück