This guide helps you build and install Snort.
- Setup Repositories
- Download source code
git clone https://github.com/sdnfv/onvm-snort cd onvm-snort
- Initialize openNetVM submodule
git submodule sync git submodule update --init
- Compile DPDK and openNetVM
Please follow the openNetVM installation guide.
- Compile DAQ
- Install dependencies.
sudo apt-get install -y libpcap-dev libpcre3-dev libdumbnet-dev zlib1g-dev liblzma-dev libssl-dev autoconf flex bison luajit libtool libglib2.0-dev pkg-config
- Navigate to the DAQ source directory.
cd daq-2.0.6/
- Prepare for automake, then autocreate makefile.
autoreconf -ivf aclocal autoconf autoheader automake -a
- Run the configuration script and include the dpdk and netvm libraries.
User should see yes for both DPDK and NetVM DAQs
./configure --enable-static --disable-shared --with-dpdk-includes=$RTE_SDK/$RTE_TARGET/include --with-dpdk-libraries=$RTE_SDK/$RTE_TARGET/lib --with-netvm-includes=$ONVM_HOME/onvm --with-netvm-libraries=$ONVM_HOME/onvm
- Build the DAQ
make clean make -j7 sudo make install
- Compile Snort
- Navigate to the snort source directory.
cd snort-2.9.8.3/
- Prepare for automake, then autocreate makefile.
autoreconf -ivf aclocal autoconf autoheader automake -a
- Run the configuration script.
./configure --enable-sourcefire --enable-static --disable-shared
- Navigate to the src folder of snort and Make snort.
cd snort-2.9.8.3/src make clean make -j7 sudo make install
- Configure linker.
sudo ldconfig
- Configure and run openNetVM-snort
-
Copy snort files into
/etc/snort
and create dynamic rules folder.sudo cp -r snort-2.9.8.3/simple-etc /etc/snort sudo mkdir /usr/local/lib/snort_dynamicrules
-
Add snort to path (change /opt/snort if the install path is different)
export PATH=$PATH:/opt/snort/bin
-
Run openNetVM manager. To install openNetVM, refer to this guide.
cd openNetVM/onvm ./go.sh 0,1,2,3 3 0xF0 -a 0x7f000000000 -s stdout
-
Run Snort.
sudo snort -A console -Q -c /etc/snort/snort.conf -i dpdk0 -N --alert-before-pass --daq-var netvm_args="-l 5 -n 3 --proc-type=secondary -- -r 1 -- -d 4"
If the above does not work then try:
which snort sudo `which snort` -A console -Q -c /etc/snort/snort.conf -i dpdk0:dpdk1 -N --alert-before-pass --daq-var netvm_args="-l 5 -n 3 --proc-type=secondary -- -r 1 -- -d 4"
-
Run Bridge.
cd openNetVM-dev/examples/bridge/ ./go.sh 6 4