docs: update IPv6Notes regarding flowtop
[netsniff-ng.git] / INSTALL
blob7a8573b1364995843013da5579df3349291b9aad
1 Currently only operating systems running on Linux kernels with the option
2 CONFIG_PACKET_MMAP enabled. This feature can be found even back to the days of
3 2.4 kernels. Most operating systems ship pre-compiled kernels that have this
4 config option enabled and even the latest kernel versions got rid of this
5 option and have this functionality already built-in. However, we recommend a
6 kernel >= 2.6.31, because the TX_RING is officially integrated since then. In
7 any case, if you have the possibility, consider getting the latest kernel from
8 Linus' Git repository, tweak and compile it, and run this one!
10 A note for distribution package maintainers:
12 By default, netsniff-ng has some architecture-specific tuning options enabled
13 that don't belong into a package binary of a distribution. Hence, you might
14 want to adapt some build-related things before starting to package the toolkit.
15 All necessary things (e.g., CFLAGS,WFLAGS) can be found in src/Makefile. Hence,
16 you need to adapt it there.
18 What tools are required to build netsniff-ng?
20  - gcc, make, sed, perl, coreutils (all)
21  - ccache (optional)
22  - flex, bison (bpfc, trafgen)
23  - asciidoc (man-pages)
25 What libraries are required?
27  - glibc (all)
28  - libncurses (ifpps, flowtop)
29  - libGeoIP >=1.4.8 (astraceroute, flowtop)
30  - libnacl (curvetun)
31  - libnetfilter-conntrack (flowtop)
32  - liburcu (flowtop)
33  - libnl3 (netsniff-ng, trafgen)
34  - libnet (mausezahn)
35  - libpcap (mausezahn)
36  - libcli (mausezahn)
38 What additional tools are recommended after the build?
40  - ntpd (curvetun)
41  - setcap (all)
43 It is common, that these libraries are shipped as distribution packages
44 for an easy installation. We try to keep this as minimal as possible.
46 After downloading the netsniff-ng toolkit, you should change to 'src':
48   $ cd netsniff-ng/src/
50 The installation (deinstallation) process done by make is fairly simple:
52   $ make
53   # make install
55   (# make distclean)
56   ($ make clean)
57   (or for both at once: # make mrproper)
59 You can also build only a particular tool, e.g.:
60   
61   $ make trafgen
62   # make trafgen_install
64   (# make trafgen_distclean)
65   ($ make trafgen_clean)
67 In order to build curvetun, libnacl must be built first. A helper script
68 called build_nacl.sh is there to facilitate this process. If you want to
69 build NaCl in the directory ~/nacl, the script should be called this way:
71   $ cd src/curvetun
72   $ ./build_nacl.sh ~/nacl
74 There's also an abbreviation for this by simply typing:
76   $ make nacl
78 This gives an initial output such as "Building NaCl for arch amd64 on host
79 fuuubar (grab a coffee, this takes a while) ...". If the automatically
80 detected architecture (such as amd64) is not the one you intend to compile
81 for, then edit the (cc="gcc") variable within the build_nacl.sh script to
82 your cross compiler. Yes, we know, the build system of NaCl is a bit of a
83 pain, so you might check for a pre-built package from your distribution in
84 case you are not cross compiling.
86 If NaCl already has been built on the target, it is quicker to use
87 nacl_path.sh this way:
89   $ cd src/curvetun
90   $ ./nacl_path.sh ~/nacl/build/include/x86 ~/nacl/build/lib/x86
92 When done, netsniff-ng's build infrastructure will read those evironment
93 variables in order to get the needed paths to NaCl.
95 In case you have to manually install libgeoip in version 1.4.8 or higher, you
96 can also use the provided helper script called build_geoip.sh from the
97 src/astraceroute directory (depending on your distribution, you might want to
98 adapt paths within the script):
100   $ cd src/astraceroute
101   # ./build_geoip.sh
103 Again, there's also an abbreviation for this by simply typing:
105   # make geoip
107 For downloading the latest GeoIP database, you should use the script that
108 is located at scripts/geoip-database-update, or use:
110   # make update
112 If you're unsure with any make targets, check out: make help
114 In order to run the toolkit as a normal user, set the following privilege
115 separation after the build/installation:
117   $ sudo setcap cap_net_raw,cap_ipc_lock,cap_sys_admin,cap_net_admin=eip {toolname}
119 Man pages are generated out of the files from Documentation/Manpages dir.
120 They are written in asciidoc format. For this, you need the tool asciidoc which
121 is distributed with on most Linux systems.
123 For bpfc, we also have a Vim syntax highlighting file. Have a look at
124 scripts/bpf.vim for installation instructions.
126 netsniff-ng has been successfully tested on x86 and x86_64. It should also run
127 on most other major architectures. However, since we don't have a possibility
128 to test it, please drop us a short mail, if it runs successfully on hardware
129 other than x86/x86_64.
131 For using TUN/TAP devices as a user, e.g. create a file called
132 src/50-tuntap.rules in /etc/udev/rules.d/ with ...
134 KERNEL=="tun",NAME="net/%k",GROUP="netdev",MODE="0660",OPTIONS+="ignore_remove"
136 ... and restart the udev daemon. Add yourself to the "netdev" group.
138 Add the flag -D__WITH_HARDWARE_TIMESTAMPING=1 into src/Makefile for
139 hardware timestamping support. Note that your kernel must be configured for
140 this (e.g. to ship the linux/net_tstamp.h header file).
142 The following warnings can be seen when compiling bpfc with flex 2.5.35 and
143 bison 2.4.1:
144  - redundant redeclaration of ‘isatty’
145  - cannot optimize loop, the loop counter may overflow
147 Those two warnings occur on generated C code produced by flex and bison and
148 there is no possibility on our side to fix them while staying with both tools.
150 Similar to that, gcc will throw a warning on strchr(3) which is a false
151 positive (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36513) from glibc:
152  - warning: logical ‘&&’ with non-zero constant will always evaluate as true