======talk:ifb======
I do not have ifb installed on my kernel and i do not know how to install. There is no web where i can find information. Can anybody help me?
Answer: It is part of the standard kernel starting with 2.6.12.
To enable it you need to enable:
* NET_SCHED
Networking -->
Networking Options -->
QOS and fair scheduling -->
* NET_CLS_ACT
QOS and fair scheduling -->
Actions
* IFB
Device Drivers -->
Network devices -->
IFB
===== cant redirect traffic to the ifb =====
I've set up ifb0:
----
tc -s class show dev ifb0
class htb 1:10 parent 1:1 leaf 10: prio 1 rate 80000bit ceil 160000bit burst 1700b cburst 1800b
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
lended: 0 borrowed: 0 giants: 0
tokens: 170000 ctokens: 90000
class htb 1:1 root rate 624000bit ceil 624000bit burst 2379b cburst 2379b
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
lended: 0 borrowed: 0 giants: 0
tokens: 30512 ctokens: 30512
class htb 1:20 parent 1:1 leaf 20: prio 2 rate 80000bit ceil 160000bit burst 1700b cburst 1800b
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
lended: 0 borrowed: 0 giants: 0
tokens: 170000 ctokens: 90000
class htb 1:30 parent 1:1 leaf 30: prio 3 rate 240000bit ceil 560000bit burst 1899b cburst 2299b
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
lended: 0 borrowed: 0 giants: 0
tokens: 63333 ctokens: 32857
class htb 1:40 parent 1:1 prio 4 rate 24000bit ceil 400000bit burst 1629b cburst 2100b
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
lended: 0 borrowed: 0 giants: 0
tokens: 543333 ctokens: 42000
class htb 1:41 parent 1:1 leaf 41: prio 5 rate 16000bit ceil 400000bit burst 1620b cburst 2100b
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
lended: 0 borrowed: 0 giants: 0
tokens: 810000 ctokens: 42000
class htb 1:42 parent 1:1 leaf 42: prio 6 rate 8000bit ceil 160000bit burst 1610b cburst 1800b
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
lended: 0 borrowed: 0 giants: 0
tokens: 1610000 ctokens: 90000
\\
ifconfig ifb0
ifb0 Link encap:Ethernet HWaddr 9A:AE:D9:C1:89:E7
UP BROADCAST RUNNING NOARP MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:32
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
----
\\
I have recent kernel and iproute2:
----
emerge -pv iproute2
These are the packages that would be merged, in order:
Calculating dependencies... done!
[ebuild R ] sys-apps/iproute2-2.6.20.20070313 USE="berkdb -atm -minimal" 0 kB
Total: 1 package (1 reinstall), Size of downloads: 0 kB
\\
uname -a
Linux titan 2.6.21-gentoo-r3 #1 Mon Jul 2 03:43:22 CEST 2007 x86_64 AMD Athlon(tm) 64 Processor 3000+ AuthenticAMD GNU/Linux
----
and mirred module is loaded:
\\
----
lsmod
Module Size Used by
act_mirred 4832 0
ifb 4168 0
it87 22224 0
hwmon_vid 3648 1 it87
i2c_isa 5120 1 it87
xt_state 2688 5
ipt_REDIRECT 2240 3
----
\\
but when I try to redirect traffic to it I get:
\\
----
tc filter add dev eth2 parent ffff: protocol ip prio 30 u32 match ip src 0.0.0.0/0 action mirred egress redirect dev ifb0
Action 4 device ifb0 ifindex 6
RTNETLINK answers: Invalid argument
We have an error talking to the kernel
----
===== What is "redirect"? =====
I've read all the examples and I can see that IFB magic (for shaping) happens with:
action mirred egress redirect dev ifb0
Please could someone explain what redirect means, how redirecting to an IFB device shapes incoming traffic, what mirred is, etc?
Thanks