[LARTC] iptables marked packets and TC

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have been trying to shape the traffice on a bridge i have iptables
succesfully marking packes but have not been able to get TC to read
the marked packets from Iptables and filter them into CBQ my current
config is as follows

tcclass_add="tc class add dev brint_ext parent 1: classid"
         tcclass_rate="cbq allot 1514 avpkt 1000 bounded isolated
rate"
tcclass_end=""

tc qdisc add dev brint_ext root handle 1: cbq bandwidth 192kbps avpkt
1000
$tcclass_add 1:1 $tcclass_rate 10kbps
$tcclass_add 1:2 $tcclass_rate 10kbps
$tcclass_add 1:3 $tcclass_rate 20kbps
$tcclass_add 1:4 $tcclass_rate 20kbps
$tcclass_add 1:5 $tcclass_rate 30kbps
$tcclass_add 1:6 $tcclass_rate 30kbps

iptables -t mangle -N SHAPE
# iptables -t mangle -A PREROUTING -j QUEUE
iptables -t mangle -A PREROUTING -s 65.215.218.0/24 -j SHAPE
iptables -t mangle -A PREROUTING -d 65.215.218.0/24 -j SHAPE
iptables -t mangle -A PREROUTING -s 192.168.1.0/24 -j SHAPE
iptables -t mangle -A PREROUTING -d 192.168.1.0/24 -j SHAPE




 iptables_src="iptables -t mangle -A SHAPE -s"
 iptables_dst="iptables -t mangle -A SHAPE -d"
 iptables_end="-j MARK --set-mark"

 $iptables_src 65.215.218.49 $iptables_end 1
 $iptables_dst 65.215.218.49 $iptables_end 2
 $iptables_src 65.215.218.50 $iptables_end 3
 $iptables_dst 65.215.218.50 $iptables_end 4
 $iptables_src 65.215.218.51 $iptables_end 5
 $iptables_dst 65.215.218.51 $iptables_end 6


tcf_add="tc filter add dev brint_ext protocol ip parent 1:0"
tcf_add2="prio 1 u32 match ip"
$tcf_add $tcf_add2 src 65.215.218.49 flowid 1:1
$tcf_add $tcf_add2 dst 65.215.218.49 flowid 1:2

# tcf_add="tc filter add dev brint_ext parent"
# tcf_2nd="protocol ip prio 1 handle"
# tcf_3rd="fw flowid"

# $tcf_add 1:0 $tcf_2nd 1 $tcf_3rd 1:1
# $tcf_add 1:0 $tcf_2nd 2 $tcf_3rd 1:2
# $tcf_add 1:0 $tcf_2nd 3 $tcf_3rd 1:3
# $tcf_add 1:0 $tcf_2nd 4 $tcf_3rd 1:4
# $tcf_add 1:0 $tcf_2nd 5 $tcf_3rd 1:5
# $tcf_add 1:0 $tcf_2nd 6 $tcf_3rd 1:6



[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux