I have two local interface : guest-lan and other-lan and wan inteface. My purpuse is using tc with ifb logical interface that have one htb queueing discipline between two lan inteface for example if other-lan does not use own pipe guest-lan can take maximum bandwidth and otherwise.
OTHERLAN GUESTLAN <<=== ifb0 <<=== WAN
Create queueing discipline
tc qdisc add dev ifb0 root handle 1: htb
tc class add dev ifb0 parent 1: classid 1:1 htb rate 4mbit
tc class add dev ifb0 parent 1:1 classid 1:30 htb rate 1mbit ceil 1mbit prio 3
tc class add dev ifb0 parent 1:1 classid 1:70 htb rate 1mbit ceil 1mbit prio 7
match traffic
tc filter add dev ifb0 parent 1: protocol ip u32 match ip dst all flowid 1:30
redirct all traffic FROM WAN TO IFB0
tc qdisc add dev eth1 handle ffff: ingress
tc filter add dev eth1 parent ffff: protocol ip u32 match u32 0 0 action mirred egress redirect dev ifb0
All works fine but i have problem with NAT so i can not correct match traffic which correspond to OTHERLAN or GUEST LAN
I mean this rule:
tc filter add dev ifb0 parent 1: protocol ip u32 match ip dst 192.168.1.0/24 flowid 1:30 for OTHERLAN
Any way to filter traffic after nat ?(