Skip to content

Instantly share code, notes, and snippets.

@hkwi
Created December 28, 2016 05:58
Show Gist options
  • Save hkwi/bf37f478bbddafbad21b67d0adcd3370 to your computer and use it in GitHub Desktop.
Save hkwi/bf37f478bbddafbad21b67d0adcd3370 to your computer and use it in GitHub Desktop.
Linux vxlan unicast example
Vagrant.configure(2) do |config|
config.vm.box = "minimal/xenial64"
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.define :node2 do |node|
node.vm.network :private_network, ip: "192.168.30.2"
node.vm.provision :shell, inline: <<-SHELL
ip link add vxlan5 type vxlan id 5 dstport 4789
ip addr add 192.168.5.2/24 dev vxlan5
ip link set up vxlan5
bridge fdb add 00:00:00:00:00:00 dev vxlan5 dst 192.168.30.3
SHELL
end
config.vm.define :node3 do |node|
node.vm.network :private_network, ip: "192.168.30.3"
node.vm.provision :shell, inline: <<-SHELL
ip link add vxlan5 type vxlan id 5 dstport 4789
ip addr add 192.168.5.3/24 dev vxlan5
ip link set up vxlan5
bridge fdb add 00:00:00:00:00:00 dev vxlan5 dst 192.168.30.2
SHELL
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment