I routinely start, run and close several VirtualBox-controlled virtual machines within FreeBSD. These machines use tap(4)-based networking. tap interfaces are configured in /etc/rc.conf just like all other interfaces: cloned_interfaces="tap0 tap1 tap2" ifconfig_tap0="inet 192.168.254.1/29" ifconfig_tap1="inet 192.168.254.17/28" ifconfig_tap2="inet 192.168.254.9/29" Each machine uses its own tapX. VirtualBox runs as non-root user with help of /etc/sysctl.conf: net.link.tap.user_open=1 net.link.tap.up_on_open=1 This works for first start of each VM only as tap(4) driver removes interface addresses of tapX on close. Very inconvinient. Fix: The following patch introduces new per-interface sysctls that may be used to keep addresses of tap interfaces and interfaces itself up on close: net.link.tap.0.keep_up=1 net.link.tap.1.keep_up=1 net.link.tap.2.keep_up=1 Default value is 0 and corresponds to current behaviour. The patch updates manual page too. How-To-Repeat: Create tap0 with ifconfig, run an application working with tap0, restart the application and its networking fails.
Responsible Changed From-To: freebsd-bugs->freebsd-net Over to maintainer(s).
I have the same problem. This patch helps to work with bhyve when you need a network connection between the virtual machine and the host.
These days tap(4) has IFF_LINK0 flag to keep interface up on close, so one can just use following in /etc/rc.conf: ifconfig_tap0="inet 192.168.0.1/29 link0"
*** Bug 199136 has been marked as a duplicate of this bug. ***