There seems to be a major difference between IPv4 and v6: with IPv4 an interface does receive packets with a destination of it's own configured IP address. With IPv6 it does not:
As one can see, the echo-request is accepted by the firewall, and goes out to the correct interface. Then an echo-reply is seen by the interface, but the interface prefers not to receive it: the firewall does neither Accept nor Deny.
It cannot be a routing issue because the reply is obtained and is already here.
And ping6 works with the link-local addresses, so it cannot be a general IPv6 issue either.
Trying to do a link-local ping via the global unicast address does not work, because the interface also prefers to not receive the neighbor advertisment for these addresses.
Code:
# ifconfig tap0 inet6
tap0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=80000<LINKSTATE>
inet6 fe80::2%tap0 prefixlen 64 scopeid 0x9
inet6 2003:e7:17ff:4a2f::10 prefixlen 124
Opened by PID 2776
# ping6 -c 1 google.com
PING6(56=40+8+8 bytes) 2003:e7:17ff:4a2f::10 --> 2a00:1450:4001:801::200e
--- google.com ping6 statistics ---
1 packets transmitted, 0 packets received, 100.0% packet loss
/var/log/security
kernel: ipfw: 1 Accept ICMPv6:128.0 [2003:e7:17ff:4a2f::10] [2a00:1450:4001:801::200e] out via tap0
tcpdump -nitap0
19:01:55.943404 IP6 2003:e7:17ff:4a2f::10 > 2a00:1450:4001:801::200e: ICMP6, echo request, seq 0, length 16
19:01:55.964742 IP6 2a00:1450:4001:801::200e > 2003:e7:17ff:4a2f::10: ICMP6, echo reply, seq 0, length 16
As one can see, the echo-request is accepted by the firewall, and goes out to the correct interface. Then an echo-reply is seen by the interface, but the interface prefers not to receive it: the firewall does neither Accept nor Deny.
It cannot be a routing issue because the reply is obtained and is already here.
And ping6 works with the link-local addresses, so it cannot be a general IPv6 issue either.
Trying to do a link-local ping via the global unicast address does not work, because the interface also prefers to not receive the neighbor advertisment for these addresses.