Solved Bhyve + IPv6 can't ping from guest to host until host ping guest

Both host/guest are using FreeBSD 11.1, I created the VM using vm-byhbe.

This is host configurationhe host:
/etc/rc.conf
Code:
ifconfig_igb0_ipv6="inet6 2a01:4f8:150:84ec::1 prefixlen 64"
ipv6_activate_all_interfaces="YES"
ipv6_defaultrouter="fe80::1%igb0"
rtadvd_enable="YES"

/etc/rtadvd.conf
Code:
igb0:\
        :addrs#1:addr="2a01:4f8:150:84ec::"\
        :prefixlen#64\
        :tc=ether\
        :rltime#0\
        :rdnss="2a01:4f8:150:84ec::1":

This is the bhyve guest:

/etc/rc.conf
Code:
ifconfig_vtnet0_ipv6="inet6 accept_rtadv"
ipv6_defaultrouter="fe80::1%vtnet0"
rtsold_enable="YES"


This is the output of `ifconfig bridge0` on the host:

Code:
bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        description: vm-public
        ether 02:e0:41:b7:a4:00
        nd6 options=1<PERFORMNUD>
        groups: bridge
        id 00:00:00:00:00:00 priority 0 hellotime 2 fwddelay 15
        maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
        root id 00:00:00:00:00:00 priority 0 ifcost 0 port 0
        member: tap0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 7 priority 128 path cost 2000000
        member: igb0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 1 priority 128 path cost 2000000


The first problem I found is that after booting the VM, it takes a while to get an IP, in some cases I need to restart rtadvd and only then I can get an IP, the error I have in the logs is this one:

Code:
rtadvd[1871]: <getconfig> inet_pton failed for 2a01:4f8:150:84ec::


After the VM gets an IP, I can ping other hosts for example 2001:4860:4860::8844, but not the host itself, therefore I can't resolve to any domain, this is because I am using unbound on the host and is the DNS (/etc/resolve.conf) that I have defined.

The only way I have found so far to fix this issue, is to ping from the Host to the IPv6 on the guest, after doing that everything works as expected.

Any ideas about what could it be wrong? for testing, I disabled pf (pfctl -d) but still not working.

Thanks in advance.
 
Code:
ifconfig_vtnet0_ipv6="inet6 accept_rtadv"
ipv6_defaultrouter="fe80::1%vtnet0"
rtsold_enable="YES"
Don't set ipv6_defaultrouter, besides giving out SLAAC addresses, routing is also set up through routing advertisements (hence its name). So there's no need to set it.
 
I manage to fix this, the main trick was to use only the bridge interface and enable auto_linklocal on it. now I do get the router address and guest can ping the hosts, something like this:

Code:
ifconfig_igb0="inet X.X.X.X netmask 255.255.255.XXX"
defaultrouter="X.X.X.X"
gateway_enable="YES" 
ipv6_activate_all_interfaces="YES" 
ipv6_defaultrouter="fe80::1%bridge0" 
ipv6_gateway_enable="YES" 
cloned_interfaces="bridge0 tap0" 
autobridge_interfaces="bridge0" 
autobridge_bridge0="tap* igb0" 
ifconfig_bridge0="addm igb0 addm tap0 up description bhyve" 
ifconfig_bridge0_ipv6="inet6 2a01:4f8:350:84ec::1 prefixlen 64 auto_linklocal"
rtadvd_enable="YES" 
rtadvd_interfaces="bridge0"
 
Back
Top