This repository has been archived by the owner on Mar 24, 2021. It is now read-only.
forked from ivanlysogor/hse-gobgp-bgp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
76 lines (53 loc) · 2.62 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
Vagrant.configure("2") do |config|
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
end
config.vm.define "rt1" do |server|
server.vm.box = "generic/ubuntu1804"
server.vm.hostname = "rt1"
# Copy GoBGP config
server.vm.provision "file", source: "gobgpd.rt1.conf", destination: "/tmp/gobgpd.conf"
server.vm.provision "file", source: "zebra.conf", destination: "/tmp/zebra.conf"
server.vm.provision "shell", privileged: true, inline: "sed -i -e 's/\r$//' /tmp/gobgpd.conf"
# for outside world
server.vm.network "private_network", ip: "10.10.0.10", netmask: "255.255.255.0"
# for connection between rt1 and rt2
server.vm.network "private_network", ip: "10.20.0.10", netmask: "255.255.255.0"
# for inside world
server.vm.network "private_network", ip: "172.20.10.10", netmask: "255.255.255.0"
# do basic setup
server.vm.provision "shell", path: "basic-setup.sh"
end
config.vm.define "rt2" do |server|
server.vm.box = "generic/ubuntu1804"
server.vm.hostname = "rt2"
# Copy GoBGP config
server.vm.provision "file", source: "gobgpd.rt2.conf", destination: "/tmp/gobgpd.conf"
server.vm.provision "file", source: "zebra.conf", destination: "/tmp/zebra.conf"
server.vm.provision "shell", privileged: true, inline: "sed -i -e 's/\r$//' /tmp/gobgpd.conf"
# for outside world
server.vm.network "private_network", ip: "10.10.0.20", netmask: "255.255.255.0"
# for connection between rt1 and rt2
server.vm.network "private_network", ip: "10.20.0.20", netmask: "255.255.255.0"
# for inside world
server.vm.network "private_network", ip: "172.20.20.10", netmask: "255.255.255.0"
# do basic setup
server.vm.provision "shell", path: "basic-setup.sh"
server.vm.provision "shell", privileged: true, inline: "sysctl net.ipv4.ip_forward=1"
end
config.vm.define "rt3" do |server|
server.vm.box = "generic/ubuntu1804"
server.vm.hostname = "rt3"
# Copy GoBGP config
server.vm.provision "file", source: "gobgpd.rt3.conf", destination: "/tmp/gobgpd.conf"
server.vm.provision "file", source: "zebra.conf", destination: "/tmp/zebra.conf"
server.vm.provision "shell", privileged: true, inline: "sed -i -e 's/\r$//' /tmp/gobgpd.conf"
# for outside world
server.vm.network "private_network", ip: "10.10.0.30", netmask: "255.255.255.0"
# for inside world
server.vm.network "private_network", ip: "172.20.30.10", netmask: "255.255.255.0"
# do basic setup
server.vm.provision "shell", path: "basic-setup.sh"
end
end