-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVagrantfile
52 lines (49 loc) · 1.85 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
config.vm.provider "virtualbox" do |v|
v.memory = 512
v.cpus = 1
end
config.vm.box = "debian/contrib-stretch64"
config.vm.provision "shell", inline: <<-SHELL
sudo apt-get update
sudo apt-get install -y tcpdump
SHELL
config.vm.define "netflow" do |node|
node.vm.hostname = "netflow"
node.vm.network "private_network", ip: "10.0.0.2", virtualbox_intnet: "ext"
node.vm.provision "shell", inline: <<-SHELL
sudo apt-get install -y git module-assistant iptables iptables-dev pkg-config linux-headers-$(uname -r) build-essential
git clone https://github.com/aabc/ipt-netflow.git ipt-netflow
cd ipt-netflow
sudo m-a prepare
sudo ./configure
sudo make all install
sudo depmod
SHELL
node.vm.provision "shell", run: "always", inline: <<-SHELL
sudo modprobe ipt_NETFLOW destination=10.0.0.3:2055 protocol=9
#sudo modprobe ipt_NETFLOW destination=10.0.0.3:2055 protocol=7
#sudo modprobe ipt_NETFLOW destination=10.0.0.3:2055
sudo iptables -I INPUT -j NETFLOW
sudo iptables -I OUTPUT -j NETFLOW
SHELL
end
config.vm.define "collector" do |node|
node.vm.hostname = "collector"
node.vm.network "private_network", ip: "10.0.0.3", virtualbox_intnet: "ext"
node.vm.provision "shell", inline: <<-SHELL
sudo apt install -y python3 python3-pip
sudo pip3 install ipdb
sudo pip3 install -e /vagrant/netflow/
SHELL
node.vm.provision "shell", run: "always", inline: <<-SHELL
#python3 /vagrant/netflow/netflow_exporter.py
SHELL
end
end