# bhyve guest start/stop causes host interface to come down then up



## edenist (Mar 10, 2018)

I'm running 11.1 with a number of jails, using ezjail for admin/control.
Each jail runs on the same NIC, each with an unique aliased IP address.

I also have a couple of bhyve guests, for which I am using vm-bhyve for admin/control. I have created a bridge interface so each guest can access my network directly with its own tap interface.

When all jails running, below is an excerpt from ifconfig showing the jail IPs


```
inet 192.168.1.203 netmask 0xffffff00 broadcast 192.168.1.255 
    inet 192.168.1.204 netmask 0xffffff00 broadcast 192.168.1.255 
    inet 192.168.1.205 netmask 0xffffff00 broadcast 192.168.1.255 
    inet 192.168.1.206 netmask 0xffffff00 broadcast 192.168.1.255 
    inet 192.168.1.208 netmask 0xffffff00 broadcast 192.168.1.255 
    inet 192.168.1.209 netmask 0xffffff00 broadcast 192.168.1.255 
    inet 192.168.1.210 netmask 0xffffff00 broadcast 192.168.1.255 
    inet 192.168.1.211 netmask 0xffffff00 broadcast 192.168.1.255 
    inet 192.168.1.213 netmask 0xffffff00 broadcast 192.168.1.255 
    inet 192.168.1.201 netmask 0xffffff00 broadcast 192.168.1.255
```

When I startup or shutdown a bhyve guest, the IP at the top of the list will drop out. So, in the example above, IP address 192.168.1.203 will be removed as an alias, and the jail will lose connectivity. I have to restart the jail for the alias to be restored. 
This only occurs on IPv4. IPv6 aliases are not affected. 

Here is my /var/log/messages which shows what is occurring when I do a VM guest shutdown then startup.
em0 is the host's primary NIC
tap0 is created for the VM


```
Mar 10 17:15:41 juno kernel: tap0: link state changed to DOWN
Mar 10 17:15:41 juno kernel: em0: link state changed to DOWN
Mar 10 17:15:45 juno kernel: em0: link state changed to UP
Mar 10 17:15:51 juno dhclient: New IP Address (em0): 192.168.1.30
Mar 10 17:15:51 juno dhclient: New Subnet Mask (em0): 255.255.255.0
Mar 10 17:15:51 juno dhclient: New Broadcast Address (em0): 192.168.1.255
Mar 10 17:15:51 juno dhclient: New Routers (em0): 192.168.1.101
Mar 10 17:16:30 juno kernel: tap0: 
Mar 10 17:16:30 juno kernel: Ethernet address: 00:bd:c4:65:11:00
Mar 10 17:16:30 juno kernel: em0: link state changed to DOWN
Mar 10 17:16:30 juno kernel: bridge0: link state changed to DOWN
Mar 10 17:16:30 juno kernel: tap0: promiscuous mode enabled
Mar 10 17:16:34 juno kernel: em0: link state changed to UP
Mar 10 17:16:34 juno kernel: bridge0: link state changed to UP
Mar 10 17:16:34 juno kernel: tap0: link state changed to UP
Mar 10 17:16:41 juno dhclient: New IP Address (em0): 192.168.1.30
Mar 10 17:16:41 juno dhclient: New Subnet Mask (em0): 255.255.255.0
Mar 10 17:16:41 juno dhclient: New Broadcast Address (em0): 192.168.1.255
Mar 10 17:16:41 juno dhclient: New Routers (em0): 192.168.1.101
```

Each time the guest VM is started/stopped the whole host interface is brought down. Is this normal behaviour?

Is there a way to configure the VM network so that this doesn't occur, or if not is there a reason that one of my aliased IPs is dropped each time?


----------

