-
Notifications
You must be signed in to change notification settings - Fork 4
/
Vagrantfile
37 lines (36 loc) · 1.18 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
VAGRANT_BOX = 'bobfraser1/alpine316'
VM_HOSTNAME = 'router'
VM_NETWORK = 'vboxnet1'
VM_IP = '192.168.60.2'
VM_MEMORY = '2048'
VM_CPUS = '2'
PUBLIC_NET = 'eth0'
PRIVATE_NET = 'eth1'
INTERFACE = 'eth1'
DOMAIN = 'example.com'
DHCP_RANGE = '192.168.60.100,192.168.60.254,12h'
Vagrant.configure('2') do |config|
config.vm.box = VAGRANT_BOX
config.vm.hostname = VM_HOSTNAME
config.vm.network 'private_network', name: VM_NETWORK, ip: VM_IP
config.vm.synced_folder '.', '/vagrant', disabled: true
config.vm.provision 'shell',
path: 'scripts/iptables.sh',
env: {
'PUBLIC_NET' => PUBLIC_NET,
'PRIVATE_NET' => PRIVATE_NET
}
config.vm.provision 'shell',
path: 'scripts/dnsmasq.sh',
env: {
'INTERFACE' => INTERFACE,
'DOMAIN' => DOMAIN,
'DHCP_RANGE' => DHCP_RANGE
}
config.vm.provision 'shell', path: 'scripts/dhcp-hosts.sh'
config.vm.provider 'virtualbox' do |vm|
vm.name = VM_HOSTNAME
vm.memory = VM_MEMORY
vm.cpus = VM_CPUS
end
end