adding docker
This commit is contained in:
parent
aaeee58d53
commit
51c7cea497
69
docs/DOCKER_INSTALL.md
Normal file
69
docs/DOCKER_INSTALL.md
Normal file
@ -0,0 +1,69 @@
|
||||
|
||||
You can run docker from pre built container.
|
||||
|
||||
First, get fastnetmon.conf from github, edit it after download.
|
||||
|
||||
```
|
||||
wget https://raw.githubusercontent.com/FastVPSEestiOu/fastnetmon/master/src/fastnetmon.conf -O /etc/fastnetmon.conf
|
||||
```
|
||||
|
||||
|
||||
Now create networks.list. Replace CIDR-1/20 and CIDR-2/19 with your
|
||||
|
||||
```
|
||||
echo "CIDR-1/20
|
||||
CIDR-2/19" > /etc/networks.list
|
||||
````
|
||||
|
||||
|
||||
Now create log files to access them outside cointainer
|
||||
|
||||
```
|
||||
touch /var/log/fastnetmon.log
|
||||
chmod 0644 /var/log/fastnetmon.log
|
||||
|
||||
mkdir /var/log/fastnetmon_attacks
|
||||
chmod 0700 /var/log/fastnetmon_attacks
|
||||
|
||||
```
|
||||
|
||||
Downloading image
|
||||
|
||||
```
|
||||
docker pull robertoberto/fastnetmon
|
||||
```
|
||||
|
||||
|
||||
You can run docker manually to test it, or run from a screen.
|
||||
|
||||
In this case we're mapping IPFIX to container. Replace IPFIX1 and IPFIX2 with your local network interface ip which listen to IPFIX from your routers. You can use only one IPFIX interface or more.
|
||||
|
||||
|
||||
```
|
||||
docker run -a stdin -a stdout -i \
|
||||
-v /var/log/fastnetmon_attacks:/var/log/fastnetmon_attacks \
|
||||
-v /var/log/fastnetmon.log:/var/log/fastnetmon.log \
|
||||
-v /etc/networks_list:/etc/networks_list \
|
||||
-v /etc/fastnetmon.conf:/etc/fastnetmon.conf \
|
||||
-p IPFIX1:2055:2055/udp \
|
||||
-p IPFIX2:2055:2055/udp \
|
||||
-t robertoberto/fastnetmon /bin/bash
|
||||
```
|
||||
|
||||
Now you're inside container. Run
|
||||
|
||||
```
|
||||
fastnetmon &
|
||||
|
||||
fastnetmon_client
|
||||
```
|
||||
|
||||
|
||||
Also you can build your own image using Dockerfile at packages/docker
|
||||
|
||||
```
|
||||
cd packages/docker
|
||||
docker build .
|
||||
```
|
||||
|
||||
|
36
packages/docker/Dockerfile
Normal file
36
packages/docker/Dockerfile
Normal file
@ -0,0 +1,36 @@
|
||||
FROM ubuntu
|
||||
MAINTAINER robertoberto
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
bison \
|
||||
build-essential \
|
||||
cmake \
|
||||
flex \
|
||||
g++ \
|
||||
gcc \
|
||||
git \
|
||||
libboost-all-dev \
|
||||
libgeoip-dev \
|
||||
libgpm-dev \
|
||||
libhiredis-dev \
|
||||
liblog4cpp5-dev \
|
||||
libncurses5-dev \
|
||||
libnuma-dev \
|
||||
libpcap-dev \
|
||||
linux-headers-$(uname -r) \
|
||||
make
|
||||
|
||||
|
||||
RUN cd /usr/src; git clone https://github.com/FastVPSEestiOu/fastnetmon.git
|
||||
|
||||
|
||||
RUN cd /usr/src/fastnetmon/src; mkdir build; cd build; cmake .. -DDISABLE_PF_RING_SUPPORT=ON; make
|
||||
|
||||
RUN cp /usr/src/fastnetmon/src/fastnetmon.conf /etc/
|
||||
RUN cp /usr/src/fastnetmon/src/build/fastnetmon /usr/bin/
|
||||
RUN cp /usr/src/fastnetmon/src/build/fastnetmon_client /usr/bin/
|
||||
RUN touch /etc/networks_list
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user