Before installing MMT-probe, we need to install MMT-SDK.
To compile and install MMT-SDK follow the instructions in MMT-SDK section here.
MMT-probe requires certain software packages to be installed beforehand . Following are the list of packages along with their installation and compilation instructions.
sudo su
apt-get install build-essential
add-apt-repository ppa:ubuntu-toolchain-r/test
apt-get update
apt-get install gcc-4.9 g++-4.9 cpp-4.9
#after that if you check the version of gcc you will find the old version
gcc --version
#so we can fix it with simple symbolic
cd /usr/bin
rm gcc g++ cpp
ln -s gcc-4.9 gcc
ln -s g++-4.9 g++
ln -s cpp-4.9 cpp
This library is used to parse the configuration file.
sudo apt-get install libconfuse-dev
There exist some other optional requirements that depend on compile parameters when compiling. They will be detaillede just below.
Download MMT-Probe from bitbucket
git clone https://bitbucket.org/montimage/mmt-probe.git
Using GNU Make to compile probe: make <options> action
. User can press <tab>
key, make <tab>
, to obtain the list of options and actions as the following:
mmt@ubuntu:~/mmt-probe$ make
ALL_MODULES NETCONF_MODULE clean
DEBUG PCAP_DUMP_MODULE deb
DISABLE_REPORT QOS_MODULE dist-clean
DPDK_CAPTURE REDIS_MODULE gperf
DYNAMIC_CONFIG_MODULE SECURITY_MODULE gperf-clean
FTP_RECONSTRUCT_MODULE SIMPLE_REPORT install
HTTP_RECONSTRUCT_MODULE SOCKET_MODULE keygen
KAFKA_MODULE TCP_REASSEMBLY_MODULE rpm
LICENSE_MODULE VERBOSE
MONGODB_MODULE compile
The options are in UPPERCASE, while the action are in lowercase.
For example, to compile MMT-Probe to use DPDK: make DPDK_CAPTURE compile
This option prints detail about compiling process
This option enable -g -O0
compile flags to be able to use gdb
to debug
This enables probe to check license information when starting. If no license is found or it is expired, probe will exit immediately.
Do not perform DPI statistics such as, session report, event report, etc. Consequently no DPI reports will be output.
This option is very helpful if user want to get higher performance for security or dumping network packets to pcap files.
This option enables a simple version of DPI reports: only some attributes (source and desstination of IP, MAC, port number; and upload and download volumes) session report. It is used for MMT-Box.
MMT-Probe supports either libpcap or dpdk to capture packets. Libpcap is selected by default.
#Use DPDK
make DPDK_CAPTURE compile
#Use PCAP
make compile
In addition to output reports to files, MMT-Probe can ouput to redis, kafka and mongodb servers.
Install required libraries
- When output to redis, we need
hiredis
library
# install hiredis library
git clone https://github.com/redis/hiredis.git
cd hiredis
make
sudo make install
sudo ldconfig
- When output to kafka, we need
librdkafka
#install librdkafka (C/C++ kafka client library)
sudo apt-get install -y libsasl2-dev libssl-dev # required by librdkafka
git clone https://github.com/edenhill/librdkafka.git
cd librdkafka
./configure
make
sudo make install
sudo ldconfig
- When output to mongodb, we need
libmongo
andlibbson
sudo apt-get install pkg-config libssl-dev libsasl2-dev
wget https://github.com/mongodb/mongo-c-driver/releases/download/1.9.5/mongo-c-driver-1.9.5.tar.gz
tar xzf mongo-c-driver-1.9.5.tar.gz
cd mongo-c-driver-1.9.5
./configure --disable-automatic-init-and-cleanup
make
sudo make install
Compile MMT-Probe:
#support output to file, redis and kafka servers
make REDIS_MODULE KAFKA_MODULE compile
#or support only output to file and mongodb server
make MONGODB_MODULE compile
These compile options require MMT-Security
to be installed respectively (see https://bitbucket.org/montimage/mmt-security).
#support mmt-security
make SECURITY_MODULE compile
Add a module to dump packets to pcap files
Add a module allowing to modify configuration parameters at runtime
By default, the dynamic reconfiguration receives new parameters via socket. This option enable the reception via net_conf protocol.
This compile option requires Sysrepo
and netopeer2 server
.
This option enables reconstruction of tcp payload
Add all modules in probe.
make ALL_MODULE compile
compile
: compile source code to obtain executable fileprobe
clean
: clean files generated by compiler, such as, .o filekeygen
: compile serial key generator programinstall
: install MMT-Probe on the current machinedist-clean
: remove MMT-Probe that was installed byinstall
actiondeb
: create debian-based package (tested on Debian, Ubuntu)rpm
: create REL-based package (tested on CentOS, Fedora)gperf
: generate code files by gperf tool to take into account perfect hashinggperf-clean
: delete the code files generated by gperf tool
This option specify a based-folder on which the MMT toolchains have been installed:
- when using with
make install MMT_BASE=/tmp/mmt
, then MMT-Probe will be installed on/tmp/mmt/probe
instead of its default folder/opt/mmt/probe
- This option also needs when MMT-DPI and MMT-Security are not installed in the default folders. So makefile will try to find DPI and Security in
/tmp/mmt
instead of/opt/mmt
This option links statically MMT-DPI (mmt_core
+ mmt_tcpip
) and MMT-Security into MMT-Probe.
This is, the executable binary file of MMT-Probe contains these libraries.
Consequently we do not need to install these libraries into a new machine when installing MMT-Probe,
only one executable file is enough.
Currently, the following libraries will be statically linked (embedded) into probe:
- libmmt-dpi
- libmmt-security2
- libpcap
- libconfuse
- libhiredis
When running ./probe -h
, we obtain:
mmt@ubuntu:~/mmt-probe$ ./probe -h
./probe [<option>]
Option:
-v : Print version information, then exits.
-c <config file> : Gives the path to the configuration file (default: ./mmt-probe.conf, /opt/mmt/probe/mmt-probe.conf).
-t <trace file> : Gives the trace file for offline analyse.
-i <interface> : Gives the interface name for live traffic analysis.
-X attr=value : Override configuration attributes.
For example "-X file-output.enable=true -Xfile-output.output-dir=/tmp/" will enable output to file and change output directory to /tmp.
The parameter -X can appear several times.
-x : Prints list of configuration attributes being able to be used with -X, then exits.
-h : Prints this help, then exits.
sudo ./probe -c mmt-probe.conf
The MMT-Probe service is available only when MMT-Probe is installed in to its default folder, at /opt/mmt/probe
. Thus when it is compiled with option MMT_BASE=...
, the service will not be generated. When generating service, MMT-Probe needs to be installed under root
permission. However when MMT_BASE
is present, user wants to install MMT to another folder, without root, so MMT-Probe cannot introduce its service.
When executing as service, MMT-Probe uses the default configuration file located at /opt/mmt/probe/mmt-probe.conf
sudo service mmt-probe start
#see status
sudo service mmt-probe status
#stop the service if need
sudo service mmt-probe stop
Probe writes it execution log using syslog
. To view the log, do journalctl -t mmt-probe