I use vagrant to provision some virtual machines to deploy kubernetes locally. Now I am working IPv6 functionality and have some issues.
Host: Ubuntu 22.04 with VirtualBox 6.1
Guest: Oracle Linux 8
I create 6 virtual machines via vagrant with 1 NAT network and 1 private network. The private Network is defined as eth1 in guest.
Then I add IPv6 via ifconfig:
Code: Select all
ifconfig eth1 inet6 add #{ip6}/64
- v6prefix = "192.168.59."
- v6prefix = "fddd:0:0:1ff::"
Ping-Status:
- ipv4 from host to guest => not working
- ipv6 from guest to guest => working
- ipv6 from guest to hist => seems not to work because answer comes from guest, not host I think
On my host the route table looks like this:
Code: Select all
$ ip -6 route
::1 dev lo proto kernel metric 256 pref medium
2a01:4f8:173:1728::/64 dev enp6s0 proto kernel metric 256 pref medium
fddd:0:0:1ff::/64 dev vboxnet3 proto kernel metric 256 pref medium
fe80::/64 dev enp6s0 proto kernel metric 256 pref medium
fe80::/64 dev tun0 proto kernel metric 256 pref medium
fe80::/64 dev vboxnet3 proto kernel metric 256 pref medium
fe80::/64 dev veth2d637d7 proto kernel metric 256 pref medium
fe80::/64 dev docker0 proto kernel metric 256 pref medium
default via fe80::1 dev enp6s0 proto static metric 1024 pref medium
I want to access my guest via browser from host via IPv6 and IPv6 (is working currently). And I want to use a private address range, not public addresses.
I also tested with link-local, but because of the missing implementation of interface specification "ipv6:interface" in the browser, this does not work for me.
Vagrant file:
Code: Select all
VAGRANTFILE_API_VERSION = "2"
v4prefix = "192.168.59."
v6prefix = "fddd:0:0:1ff::"
$num_instances = 6
$vm_memory ||= 4096
$vm_cpus ||= 2
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "generic/oracle8"
config.ssh.insert_key = false
(1..$num_instances).each do |i|
config.vm.define vm_name = "k8s-%01d" % [i] do |node|
node.vm.hostname = vm_name
node.vm.provider :virtualbox do |vb|
vb.memory = $vm_memory
vb.cpus = $vm_cpus
vb.gui = false
vb.linked_clone = true
vb.customize ["modifyvm", :id, "--vram", "8"] # ubuntu defaults to 256 MB which is a waste of precious RAM
vb.customize ["modifyvm", :id, "--audio", "none"]
end
ip = "#{v4prefix}#{i+100}"
ip6 = "#{v6prefix}#{i+100}"
node.vm.network "private_network", ip: ip
node.vm.provision "shell", inline: "systemctl stop firewalld; systemctl disable firewalld"
node.vm.provision "shell", run: "always", inline: "sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0"
node.vm.provision "shell", run: "always", inline: "sudo sysctl -w net.ipv6.conf.eth1.disable_ipv6=0"
node.vm.provision "shell", run: "always", inline: "echo 0 > /proc/sys/net/ipv6/conf/eth1/disable_ipv6"
# manual ipv6
node.vm.provision "shell",
run: "always",
inline: "ifconfig eth1 inet6 add #{ip6}/64 || true"
end
end
end