This repository has been archived by the owner on Jul 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Vagrantfile
172 lines (152 loc) · 5.79 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
require "vagrant-host-shell"
require "vagrant-junos"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
#VM1
#Student VM
config.vm.define "ndo", primary: true do |ndo|
ndo.vm.box = "juniper/netdevops-ubuntu1404-headless"
ndo.vm.hostname = "NetDevOps-Student"
ndo.vm.network "private_network",
ip: "172.16.0.10",
virtualbox__intnet: "NetDevOps-StudentInternal"
ndo.vm.synced_folder "", "/vagrant"
ndo.ssh.password = "vagrant"
#Virtualbox
ndo.vm.provider "virtualbox" do |v|
v.gui = false
v.customize ["modifyvm", :id, "--memory", "512"]
end
#VMware configuration
ndo.vm.provider "vmware_fusion" do |v|
v.vmx["memsize"] = "512"
v.vmx["ethernet1.generatedAddress"] = nil
v.vmx["ethernet1.connectionType"] = "custom"
v.vmx["ethernet1.present"] = "TRUE"
v.vmx["ethernet1.vnet"] = "vmnet0"
end
#Provisioning
ndo.vm.provision "file", source: "tools/gogoHTTP/gogoHTTPD", destination: "/tmp/gogoHTTPD"
ndo.vm.provision "file", source: "tools/gogoHTTP/gogohttpd.conf", destination: "/tmp/gogohttpd.conf"
ndo.vm.provision "shell" do |s|
# this script provisions the ndo box for you
s.path = "scripts/ndo-setup.sh"
end
end
#VM2
#Student SRX
config.vm.define "srx" do |srx|
srx.vm.box = "juniper/ffp-12.1X47-D20.7"
srx.vm.hostname = "Student-SRX01"
srx.vm.network "private_network",
ip: "172.16.0.1",
nic_type: 'virtio',
virtualbox__intnet: "NetDevOps-StudentInternal"
srx.vm.network "private_network",
ip: "10.10.0.10",
netmask: "255.255.252.0",
nic_type: 'virtio',
virtualbox__intnet: "NetDevOps-Public"
srx.vm.synced_folder "", "/vagrant", disabled: true
#Virtualbox
srx.vm.provider "virtualbox" do |v|
# increase RAM to support AppFW and IPS
# comment out to make it run at 2GB
v.customize ["modifyvm", :id, "--memory", "3072"]
v.check_guest_additions = false
end
#VMware configuration
#vmnet0 for Internal Network
#vmnet1 for External Network
srx.vm.provider "vmware_fusion" do |v|
v.vmx["memsize"] = "3072"
v.vmx["ethernet1.generatedAddress"] = nil
v.vmx["ethernet1.connectionType"] = "custom"
v.vmx["ethernet1.present"] = "TRUE"
v.vmx["ethernet1.vnet"] = "vmnet0"
v.vmx["ethernet2.generatedAddress"] = nil
v.vmx["ethernet2.connectionType"] = "custom"
v.vmx["ethernet2.present"] = "TRUE"
v.vmx["ethernet2.vnet"] = "vmnet1"
end
#Provisioning
srx.vm.provision "file", source: "scripts/student-srx-setup.sh", destination: "/tmp/srx-setup.sh"
srx.vm.provision :host_shell do |host_shell|
# provides the inital configuration
host_shell.inline = 'vagrant ssh srx -c "/usr/sbin/cli -f /tmp/srx-setup.sh"'
end
end
#VM 3
#Headend SRX
config.vm.define "srx_headend" do |srx|
srx.vm.box = "juniper/ffp-12.1X47-D20.7"
srx.vm.box_version = ">= 0.5.0"
srx.vm.hostname = "Headend-SRX02"
srx.vm.network "private_network",
ip: "10.10.0.5",
netmask: "255.255.252.0",
nic_type: 'virtio',
virtualbox__intnet: "NetDevOps-Public"
srx.vm.network "private_network",
ip: "192.168.10.1",
nic_type: 'virtio',
virtualbox__intnet: "NetDevOps-Private"
srx.vm.synced_folder "", "/vagrant", disabled: true
#Virtualbox
srx.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--memory", "2048"]
v.check_guest_additions = false
end
#VMware configuration
#vmnet0 for Internal Network
#vmnet1 for External Network
srx.vm.provider "vmware_fusion" do |v|
v.vmx["memsize"] = "2048"
v.vmx["ethernet1.generatedAddress"] = nil
v.vmx["ethernet1.connectionType"] = "custom"
v.vmx["ethernet1.present"] = "TRUE"
v.vmx["ethernet1.vnet"] = "vmnet2"
v.vmx["ethernet2.generatedAddress"] = nil
v.vmx["ethernet2.connectionType"] = "custom"
v.vmx["ethernet2.present"] = "TRUE"
v.vmx["ethernet2.vnet"] = "vmnet1"
end
srx.vm.provision "file", source: "scripts/headend-srx-setup.sh", destination: "/tmp/srx-setup.sh"
srx.vm.provision "file", source: "scripts/headend-srx-vpnstints.sh", destination: "/tmp/srx-vpnstints.sh"
srx.vm.provision :host_shell do |host_shell|
host_shell.inline = 'vagrant ssh srx_headend -c "/usr/sbin/cli -f /tmp/srx-setup.sh"'
end
srx.vm.provision :host_shell do |host_shell|
host_shell.inline = 'vagrant ssh srx_headend -c "/usr/sbin/cli -f /tmp/srx-vpnstints.sh"'
end
end
#VM 4
config.vm.define "private_server", primary: true do |ndo|
ndo.vm.box = "juniper/netdevops-ubuntu1404-headless"
ndo.vm.box_version = ">= 0.2.6"
ndo.vm.hostname = "NetDevOps-Private"
ndo.vm.network "private_network",
ip: "192.168.10.10",
virtualbox__intnet: "NetDevOps-Private"
ndo.vm.synced_folder "../", "/vagrant", disabled: false
ndo.vm.provider "virtualbox" do |v|
v.gui = false
v.customize ["modifyvm", :id, "--memory", "512"]
end
#VMware configuration
#vmnet0 for Private Network
ndo.vm.provider "vmware_fusion" do |v|
v.vmx["memsize"] = "512"
v.vmx["ethernet1.generatedAddress"] = nil
v.vmx["ethernet1.connectionType"] = "custom"
v.vmx["ethernet1.present"] = "TRUE"
v.vmx["ethernet1.vnet"] = "vmnet2"
end
ndo.vm.provision "shell" do |s|
s.path = "scripts/ndopri-setup.sh"
end
end
end