Skip to content

Commit c40fc87

Browse files
committed
Promisc module/sysctl parameter.
Also couple of portability fixes for ifDescr code.
1 parent 7141664 commit c40fc87

File tree

6 files changed

+291
-5
lines changed

6 files changed

+291
-5
lines changed

README

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ ipt_NETFLOW linux 2.6.x-3.x kernel module by <abc@telekom.ru> -- 2008-2014.
5050
* SNMP-index translation rules, let convert meaningless and unstable
5151
interface indexes (ifIndex) to more meaningful numbering scheme.
5252

53+
* Easy support for catching mirrored traffic with promisc option.
54+
5355

5456
============================
5557
= OBTAINING LATEST VERSION =

README.promisc

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,49 @@
11
Hello,
22

3-
If you wish to account with netflow module traffic mirrored on switch you may follow this example:
3+
If you wish to account with ipt-netflow module traffic mirrored on switch you may follow
4+
one of these examples:
45

56

6-
Solution 1: General kernel patch.
7-
Solution 2: Alternative w/o kernel patch.
7+
Solution 1: Promisc-hack module option. [2014]
8+
Solution 2: General kernel patch. [2008]
9+
Solution 3: Alternative w/o kernel patch, using bridges. [2010]
810

911

1012
**************
1113
* Solution 1 *
1214
**************
1315

16+
No kernel patching is need anymore! (As in easy.)
17+
18+
Compile module with `./configure --enable-promisc' option. This will enable
19+
`promisc=' module parameter and sysctl parameter `net.netflow.promisc'.
20+
Set any of these to `1' to enable promisc hack, you will see dmesg message
21+
that it's enabled, set to `0' to disable (default).
22+
23+
This option turned on will pass promisc traffic into `PREROUTING' chain
24+
of `raw' table (same as with promisc patches). Briefly it's like this:
25+
26+
# cd ipt-netflow/
27+
# ./configure --enable-promisc
28+
# make all install
29+
# iptables -A PREROUTING -t raw -i eth2 -j NETFLOW
30+
# sysctl net.netflow.promisc=1
31+
# ifconfig eth2 promisc
32+
# grep Promisc /proc/net/stat/ipt_netflow
33+
34+
Now you should be able to see promisc observed packets count increasing.
35+
36+
Note, that enabling module's parameter promisc=1 will not enable promiscuous
37+
mode on network cards, these are completely different things. This option will
38+
let iptables to see promisc traffic. That traffic will not be routed anywhere
39+
and discarded just after passing PREROUTING chain.
40+
41+
42+
43+
**************
44+
* Solution 2 *
45+
**************
46+
1447
1. Patch your kernel with `raw_promisc.patch' to enable raw table to see promisc traffic.
1548

1649
# cd /usr/src/linux
@@ -56,7 +89,7 @@ ps. For Debian Squeeze instructions look at raw_promisc_debian_squeeze6.patch
5689

5790

5891
**************
59-
* Solution 2 *
92+
* Solution 3 *
6093
**************
6194

6295
By Anonymous.

configure

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ show_help() {
259259
echo " --enable-sampler enables Flow Sampling"
260260
echo " --enable-sampler=hash enables Hash sampler"
261261
echo " --disable-aggregation disables aggregation rules"
262+
echo " --enable-promisc enables promisc hack"
262263
exit 0
263264
}
264265

@@ -287,6 +288,7 @@ do
287288
--enable-sampl*hash) KOPTS="$KOPTS -DENABLE_SAMPLER -DSAMPLING_HASH" ;;
288289
--enable-sampl*) KOPTS="$KOPTS -DENABLE_SAMPLER" ;;
289290
--disable-aggr*) KOPTS="$KOPTS -DDISABLE_AGGR" ;;
291+
--enable-promisc*) KOPTS="$KOPTS -DENABLE_PROMISC" ;;
290292
--make) echo called from make ;;
291293
-Werror) KOPTS="$KOPTS -Werror" ;;
292294
--help|-h) show_help ;;

0 commit comments

Comments
 (0)