Bug 247912 - IPv6 ndp does not work across local bridge members
Summary: IPv6 ndp does not work across local bridge members
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 12.1-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-net (Nobody)
URL:
Keywords: ipv6
Depends on:
Blocks:
 
Reported: 2020-07-11 14:30 UTC by Martin Birgmeier
Modified: 2020-10-29 08:15 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Birgmeier 2020-07-11 14:30:50 UTC
Scenario:
- FreeBSD 12.1 release patch level 6 acting as bhyve host
- The host has a local Ethernet interface em0 with IPv4 and IPv6 addresses assigned; all these addresses are announced via DNS and /etc/hosts
- Via em0, the host sees several other machines on the network; all have IPv4 and IPv6 addresses assigned, as well as DNS and /etc/hosts entries
- Using bhyve to run guests (FreeBSD 12.1 amd64 and i386, and head amd64)
- In order to use bhyve, create bridge and tap interfaces as follows:

# sysctl net.link.tap.up_on_open=1
# ifconfig bridge0 create && ifconfig bridge0 addm em0 && ifconfig bridge0 up
# ifconfig tap905 create && ifconfig bridge0 addm tap905
# sh /usr/share/examples/bhyve/vmrun.sh -u -c 4 -m 3G -t tap905 -d <disk device> <vm name>

Result:
- When using "ndp -a" in the bhyve client, entries for all remote machines exist correctly.
- However, there is no entry for the IPv6 address associated with the bridged-to interface em0
- As a result, it is not possible to reach services on the host system from the bhyve client via IPv6 (IPv4 is working)

Scenario (continued):
- Manually add ndp entries in the client:

# ndp -s <IPv6 address of host's em0> <Ethernet address of host's em0>

Result:
- It is now possible to reach services on the host system from the client system via IPv6

Expected result:
- NDP should be working also for the host's interface em0 which is bridged to bridge0, and not only for interfaces of remote machines

Note:
- The exactly same issue is seen on another bhyve host with re0 as physical interface

-- Martin
Comment 1 Qing Li freebsd_committer 2020-08-17 20:47:01 UTC
(In reply to Martin Birgmeier from comment #0)

Just to be sure, could you please provide the "ndp -a" output for both before and after the bridge0 creation?
Comment 2 Martin Birgmeier 2020-08-18 15:34:48 UTC
Hi Li,

Since you want it "before and after the creation of bridge0", the following is from the host; but the issue actually occurs on the client - I'll provide the output for that, too.

Host before "bridge0 create" and "tap904 create":

[0]# ndp -a
Neighbor                             Linklayer Address  Netif Expire    S Flags
2002:b2bf:ee7e:4d42:22cf:30ff:fe55:5cb6 20:cf:30:55:5c:b6 re0 permanent R 
fec0::4d42:22cf:30ff:fe55:5cb6       20:cf:30:55:5c:b6    re0 permanent R 
fec0:0:0:4d42::e1                    20:cf:30:55:5c:b6    re0 permanent R 
fe80::22cf:30ff:fe55:5cb6%re0        20:cf:30:55:5c:b6    re0 permanent R 
gandalf.xyzzy                        00:03:0d:4f:f3:a7    re0 23h57m34s S R
fe80::203:dff:fe4f:f3a7%re0          00:03:0d:4f:f3:a7    re0 23h55m33s S R
fe80::218:e7ff:fee0:807b%re0         00:18:e7:e0:80:7b    re0 23h55m33s S R
hal.xyzzy                            20:cf:30:55:5c:b6    re0 permanent R 
mizar.xyzzy                          f0:de:f1:98:86:a9    re0 23h58m35s S 
[0]# 

After "ifconfig bridge0 create && ifconfig bridge0 addm re0 && ifconfig bridge0 up":

[0]# ndp -a                             
Neighbor                             Linklayer Address  Netif Expire    S Flags
2002:b2bf:ee7e:4d42:22cf:30ff:fe55:5cb6 20:cf:30:55:5c:b6 re0 permanent R 
fec0::4d42:22cf:30ff:fe55:5cb6       20:cf:30:55:5c:b6    re0 permanent R 
fec0:0:0:4d42::e1                    20:cf:30:55:5c:b6    re0 permanent R 
fe80::22cf:30ff:fe55:5cb6%re0        20:cf:30:55:5c:b6    re0 permanent R 
gandalf.xyzzy                        00:03:0d:4f:f3:a7    re0 23h58m48s S R
fe80::203:dff:fe4f:f3a7%re0          00:03:0d:4f:f3:a7    re0 23h51m46s S R
fe80::218:e7ff:fee0:807b%re0         00:18:e7:e0:80:7b    re0 23h51m46s S R
hal.xyzzy                            20:cf:30:55:5c:b6    re0 permanent R 
mizar.xyzzy                          f0:de:f1:98:86:a9    re0 23h59m48s S 
[0]# 

After "ifconfig tap904 create && ifconfig bridge0 addm tap904":

[0]# ndp -a                                                
Neighbor                             Linklayer Address  Netif Expire    S Flags
2002:b2bf:ee7e:4d42:22cf:30ff:fe55:5cb6 20:cf:30:55:5c:b6 re0 permanent R 
fec0::4d42:22cf:30ff:fe55:5cb6       20:cf:30:55:5c:b6    re0 permanent R 
fec0:0:0:4d42::e1                    20:cf:30:55:5c:b6    re0 permanent R 
fe80::22cf:30ff:fe55:5cb6%re0        20:cf:30:55:5c:b6    re0 permanent R 
gandalf.xyzzy                        00:03:0d:4f:f3:a7    re0 23h58m2s  S R
fe80::203:dff:fe4f:f3a7%re0          00:03:0d:4f:f3:a7    re0 23h51m0s  S R
fe80::218:e7ff:fee0:807b%re0         00:18:e7:e0:80:7b    re0 23h51m0s  S R
hal.xyzzy                            20:cf:30:55:5c:b6    re0 permanent R 
mizar.xyzzy                          f0:de:f1:98:86:a9    re0 23h59m2s  S 
[0]# 

Now starting the bhyve VM; the rest is from inside the VM.

Before manually added ndp entries:

[0]# ndp -a
Neighbor                             Linklayer Address  Netif Expire    S Flags
v904.xyzzy                           00:a0:98:50:35:17 vtnet0 permanent R 
gandalf.xyzzy                        00:03:0d:4f:f3:a7 vtnet0 23h59m57s S R
fe80::203:dff:fe4f:f3a7%vtnet0       00:03:0d:4f:f3:a7 vtnet0 23h59m2s  S R
fe80::218:e7ff:fee0:807b%vtnet0      00:18:e7:e0:80:7b vtnet0 23h59m2s  S R
2002:b2bf:ee7e:4d42:2a0:98ff:fe50:3517 00:a0:98:50:35:17 vtnet0 permanent R 
fec0::4d42:2a0:98ff:fe50:3517        00:a0:98:50:35:17 vtnet0 permanent R 
fe80::2a0:98ff:fe50:3517%vtnet0      00:a0:98:50:35:17 vtnet0 permanent R 
mizar.xyzzy                          f0:de:f1:98:86:a9 vtnet0 23h59m57s S 
[0]# 

After "ndp -s fec0:0:0:4d42::e 20:cf:30:55:5c:b6 && ndp -s fec0:0:0:4d42::e1 20:cf:30:55:5c:b6" (the host has two IPv6 addresses assigned to its interface; fec0:0:0:4d42::e resolves to hal.xyzzy):

[0]# ndp -a
Neighbor                             Linklayer Address  Netif Expire    S Flags
fec0:0:0:4d42::e1                    20:cf:30:55:5c:b6 vtnet0 permanent R 
v904.xyzzy                           00:a0:98:50:35:17 vtnet0 permanent R 
gandalf.xyzzy                        00:03:0d:4f:f3:a7 vtnet0 23h58m54s S R
fe80::203:dff:fe4f:f3a7%vtnet0       00:03:0d:4f:f3:a7 vtnet0 23h57m59s S R
fe80::218:e7ff:fee0:807b%vtnet0      00:18:e7:e0:80:7b vtnet0 23h57m59s S R
2002:b2bf:ee7e:4d42:2a0:98ff:fe50:3517 00:a0:98:50:35:17 vtnet0 permanent R 
fec0::4d42:2a0:98ff:fe50:3517        00:a0:98:50:35:17 vtnet0 permanent R 
fe80::2a0:98ff:fe50:3517%vtnet0      00:a0:98:50:35:17 vtnet0 permanent R 
hal.xyzzy                            20:cf:30:55:5c:b6 vtnet0 permanent R 
mizar.xyzzy                          f0:de:f1:98:86:a9 vtnet0 23h58m54s S 
[0]# 

-- Martin
Comment 3 Patrick M. Hausen 2020-10-29 08:15:22 UTC
Isn't the IP configuration (both v4 and v6) supposed to go on the bridge interface instead of em0?

There should be a message upon inserting em0 as a member:

"IPv6 addresses on em0 have been removed before adding it as a member to prevent IPv6 address scope violation."