Created
July 22, 2019 14:03
-
-
Save double-p/3c66bcf09d61460c7d76c3e2b5056324 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$inet6em1='echo "inet6 $1" >> /etc/hostname.em1 && sh /etc/netstart em1' | |
$inet6carp=<<SCRIPT | |
echo "vhid 6 carpdev em1\ninet6 $1" > /etc/hostname.carp6 && sh /etc/netstart carp6 | |
SCRIPT | |
$v6fwd="v=net.inet6.ip6.forwarding=1 ; sysctl -w $v ; echo $v >> /etc/sysctl.conf" | |
Vagrant.configure("2") do |config| | |
config.vm.define "internet" do |v| | |
v.vm.box = "openbsd" | |
v.vm.network :private_network, ip: "10.123.0.3" | |
v.vm.hostname = "internet" | |
v.vm.provider :virtualbox do |vb| | |
vb.customize ["modifyvm", :id, "--nicpromisc2", "allow-vms"] | |
end | |
v.vm.provision "shell", inline: $inet6em1, args: "cafe:ea8:100:25::1/64" | |
v.vm.provision "shell", inline: "route -n add -inet6 cafe:ea8:8110::/48 cafe:ea8:100:25::2" | |
end | |
config.vm.define "gateway" do |v| | |
v.vm.box = "openbsd" | |
v.vm.network :private_network, ip: "10.123.0.2" | |
v.vm.hostname = "gateway" | |
v.vm.provider :virtualbox do |vb| | |
vb.customize ["modifyvm", :id, "--nicpromisc2", "allow-vms"] | |
end | |
v.vm.provision "shell", inline: $v6fwd | |
v.vm.provision "shell", inline: $inet6carp, args: "cafe:ea8:100:25::2/64" | |
v.vm.provision "shell", inline: $inet6em1, args: "cafe:ea8:8110::1/56" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment