I have a VM on a host with bridged networking (hence, with its own MAC address). Both host and VM run CentOS. Their network is managed by simple /etc/sysconfig/network-scripts/ifcfg-enpXsY
files which contains the static IP addresses. IPv4 works just fine.
I have assigned an IPv6 address to the VM (the host also has one) which is routed correctly in the data centre. Most connections use IPv4, however (no DNS AAAA entry for the machine yet, still testing IPv6).
When I boot up the VM it has full IPv6 connectivity. However, after a while IPv6 connectivity stops working (IPv6 magic?). I have narrowed to problem down to neighbour (ARP/NDISC cache) data:
IPv6 not working, cannot ping or connect by IPv6 in or out, then I see:
# ip -6 neighbour
fe80::1 dev enp1s2 lladdr 0c:86:72:2e:04:28 router STALE
Fix/workaround to refresh the cache:
# ip -6 neighbour flush dev enp1s2
# ip -6 neighbour
(empty, as expected)
Then ping6
the host from within the VM to fill the cache:
# ping6 2912:1375:23:9a6c::2
PING 2912:1375:23:9a6c::2(2912:1375:23:9a6c::2) 56 data bytes
64 bytes from 2912:1375:23:9a6c::2: icmp_seq=1 ttl=64 time=2.35 ms
64 bytes from 2912:1375:23:9a6c::2: icmp_seq=2 ttl=64 time=0.468 ms
^C
# ip -6 neighbour
fe80::1 dev enp1s2 lladdr 0c:86:72:2e:04:28 router REACHABLE
2912:1375:23:9a6c::2 dev enp1s2 lladdr 08:21:4b:b7:f8:31 DELAY
IPv6 neighbour/ARP table restored to validity and connectivity is working in and out!
So my questions are:
- Why does the cache become stale?
- What can I do to avoid it?'
- Why/how does the command above fix it?
Of course I could run those commands in a cron
job (how often?) but I suppose that cannot really be needed for IPv6 to work in general?
PS: I used a script for tests: The IPv6 stack breaks down about every 20 minutes. Can that be explained by RFCs?
PPS: Firewall config (shortened output, hopefully all relevant bits):
# ip6tables -nvL
Chain INPUT (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
9023 709K ACCEPT icmpv6 !lo * ::/0 ::/0
Chain OUTPUT (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
9360 785K ACCEPT icmpv6 * !lo ::/0 ::/0
So, ICMPv6 accepted in/out on the VM. Do I need to check filtering on the host?