# Bridge0 network interface is destroyed at some point of the booting process.



## ziomario (Dec 12, 2022)

Hello.

I've reinstalled FreeBSD 13.1 because I want to make some experiments to check if it supports my IGVT intel graphic card without applying any external patch. I have reconfigured the OS from scratch,but unfortunately some setting is wrong because bridge0 for some reason is destroyed and when the OS is fully loaded it is not present on the network configuration,like you can see here :

https://pastebin.ubuntu.com/p/7xSQXnDfxG/


I can show you some important configuration files,with the hope that you understand why the bridge0 is destroyed and any bhyve VM can't connect to internet.


/boot/loader.conf : https://pastebin.ubuntu.com/p/sSZ2ybs726/

/etc/rc.conf : https://pastebin.ubuntu.com/p/GhvnBCyPgN/

/etc/sysctl.conf : https://pastebin.ubuntu.com/p/DyWWrbFP4V/

dmesg : https://pastebin.ubuntu.com/p/cYnqTx78zQ/

very thanks.


----------



## VladiBG (Dec 12, 2022)

In /etc/rc.conf there is eth0 interface in the cloned_interfaces. Try to remove it from the rc.conf

```
cloned_interfaces="bridge0 tap0 tap1 tap2 tap3 tap4 tap5 tap6 tap7 tap8 tap9 tap10 tap11 tap12 tap13 tap14 tap15 tap16 tap17 tap18 tap19 tap20 eth0 lo1"
```


----------



## ziomario (Dec 12, 2022)

I've removed it,but the *bridge0* still does not exists.


```
# ifconfig

em0: flags=8863<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=481049b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,VLAN_HWFILTER,NOMAP>
    inet6 fe80::e2d5:5eff:fee2:1f22%em0 prefixlen 64 scopeid 0x1
    inet 192.168.1.2 netmask 0xffffff00 broadcast 192.168.1.255
    media: Ethernet autoselect (1000baseT <full-duplex>)
    status: active
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
    options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
    inet6 ::1 prefixlen 128
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
    inet 127.0.0.1 netmask 0xff000000
    groups: lo
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>

tap0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=80000<LINKSTATE>
    ether 58:9c:fc:10:bf:4c
    inet6 fe80::5a9c:fcff:fe10:bf4c%tap0 prefixlen 64 scopeid 0x4
    groups: tap
    media: Ethernet autoselect
    status: no carrier
    nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

tap1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=80000<LINKSTATE>
    ether 58:9c:fc:10:68:06
    inet6 fe80::5a9c:fcff:fe10:6806%tap1 prefixlen 64 scopeid 0x5
    groups: tap
    media: Ethernet autoselect
    status: no carrier
    nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

tap2: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=80000<LINKSTATE>
    ether 58:9c:fc:10:ff:f3
    inet6 fe80::5a9c:fcff:fe10:fff3%tap2 prefixlen 64 scopeid 0x6
    groups: tap
    media: Ethernet autoselect
    status: no carrier
    nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

tap3: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=80000<LINKSTATE>
    ether 58:9c:fc:10:5d:4f
    inet6 fe80::5a9c:fcff:fe10:5d4f%tap3 prefixlen 64 scopeid 0x7
    groups: tap
    media: Ethernet autoselect
    status: no carrier
    nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

tap4: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=80000<LINKSTATE>
    ether 58:9c:fc:10:ff:d6
    inet6 fe80::5a9c:fcff:fe10:ffd6%tap4 prefixlen 64 scopeid 0x8
    groups: tap
    media: Ethernet autoselect
    status: no carrier
    nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

tap5: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=80000<LINKSTATE>
    ether 58:9c:fc:00:4d:36
    inet6 fe80::5a9c:fcff:fe00:4d36%tap5 prefixlen 64 scopeid 0x9
    groups: tap
    media: Ethernet autoselect
    status: no carrier
    nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

tap6: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=80000<LINKSTATE>
    ether 58:9c:fc:10:70:09
    inet6 fe80::5a9c:fcff:fe10:7009%tap6 prefixlen 64 scopeid 0xa
    groups: tap
    media: Ethernet autoselect
    status: no carrier
    nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

tap7: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=80000<LINKSTATE>
    ether 58:9c:fc:10:ca:47
    inet6 fe80::5a9c:fcff:fe10:ca47%tap7 prefixlen 64 scopeid 0xb
    groups: tap
    media: Ethernet autoselect
    status: no carrier
    nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

tap8: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=80000<LINKSTATE>
    ether 58:9c:fc:10:ff:fd
    inet6 fe80::5a9c:fcff:fe10:fffd%tap8 prefixlen 64 scopeid 0xc
    groups: tap
    media: Ethernet autoselect
    status: no carrier
    nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

tap9: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=80000<LINKSTATE>
    ether 58:9c:fc:10:ff:9c
    inet6 fe80::5a9c:fcff:fe10:ff9c%tap9 prefixlen 64 scopeid 0xd
    groups: tap
    media: Ethernet autoselect
    status: no carrier
    nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

tap10: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=80000<LINKSTATE>
    ether 58:9c:fc:00:60:09
    inet6 fe80::5a9c:fcff:fe00:6009%tap10 prefixlen 64 scopeid 0xe
    groups: tap
    media: Ethernet autoselect
    status: no carrier
    nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

tap11: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=80000<LINKSTATE>
    ether 58:9c:fc:10:ff:c9
    inet6 fe80::5a9c:fcff:fe10:ffc9%tap11 prefixlen 64 scopeid 0xf
    groups: tap
    media: Ethernet autoselect
    status: no carrier
    nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

tap12: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=80000<LINKSTATE>
    ether 58:9c:fc:10:cb:04
    inet6 fe80::5a9c:fcff:fe10:cb04%tap12 prefixlen 64 scopeid 0x10
    groups: tap
    media: Ethernet autoselect
    status: no carrier
    nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

tap13: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=80000<LINKSTATE>
    ether 58:9c:fc:10:ff:d9
    inet6 fe80::5a9c:fcff:fe10:ffd9%tap13 prefixlen 64 scopeid 0x11
    groups: tap
    media: Ethernet autoselect
    status: no carrier
    nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

tap14: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=80000<LINKSTATE>
    ether 58:9c:fc:10:5d:66
    inet6 fe80::5a9c:fcff:fe10:5d66%tap14 prefixlen 64 scopeid 0x12
    groups: tap
    media: Ethernet autoselect
    status: no carrier
    nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

tap15: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=80000<LINKSTATE>
    ether 58:9c:fc:00:52:68
    inet6 fe80::5a9c:fcff:fe00:5268%tap15 prefixlen 64 scopeid 0x13
    groups: tap
    media: Ethernet autoselect
    status: no carrier
    nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

tap16: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=80000<LINKSTATE>
    ether 58:9c:fc:10:ff:f4
    inet6 fe80::5a9c:fcff:fe10:fff4%tap16 prefixlen 64 scopeid 0x14
    groups: tap
    media: Ethernet autoselect
    status: no carrier
    nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

tap17: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=80000<LINKSTATE>
    ether 58:9c:fc:10:e4:2e
    inet6 fe80::5a9c:fcff:fe10:e42e%tap17 prefixlen 64 scopeid 0x15
    groups: tap
    media: Ethernet autoselect
    status: no carrier
    nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

tap18: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=80000<LINKSTATE>
    ether 58:9c:fc:00:5d:71
    inet6 fe80::5a9c:fcff:fe00:5d71%tap18 prefixlen 64 scopeid 0x16
    groups: tap
    media: Ethernet autoselect
    status: no carrier
    nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

tap19: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=80000<LINKSTATE>
    ether 58:9c:fc:10:ff:c1
    inet6 fe80::5a9c:fcff:fe10:ffc1%tap19 prefixlen 64 scopeid 0x17
    groups: tap
    media: Ethernet autoselect
    status: no carrier
    nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

tap20: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=80000<LINKSTATE>
    ether 58:9c:fc:10:61:1c
    inet6 fe80::5a9c:fcff:fe10:611c%tap20 prefixlen 64 scopeid 0x18
    groups: tap
    media: Ethernet autoselect
    status: no carrier
    nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
lo1: flags=8008<LOOPBACK,MULTICAST> metric 0 mtu 16384
    options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
    groups: lo
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
```

I have added *eth0* even on the *rc.conf *of my main FreeBSD system and there I see the *bridge0* up.


----------



## ziomario (Dec 12, 2022)

Do you have another idea about why the bridge0 network interface is not shown ?


----------



## bullittman281 (Dec 16, 2022)

Hello,
I'm fighting the same/similar problem. I'm trying to get bhyve to place nice and use it instead of virtualbox. I've gotten the bridge0 and tap0 to create and persist past boot. The entry into /etc/rc.conf is:


```
cloned_interfaces="bridge0 tap0"
autobridge_interfaces="bridge0"
autobridge_bridge0="wlan0 tap0"
ifconfig_bridge0="192.168.2.0/24"
```

This may help. I found this on another thread here. I didn't save it but searching may find it. The problem in my case was the bridge is created and tries to associate before wlan0 is created and it disappears.

My problem is the VM kills tap0 after shutdown and only a reboot seems to fix it. Recreating it manually doesn't seem to help. Not sure if anybody knows. Not trying to hijack. I can start a new thread if it fits there better.


Thanks


----------



## Argentum (Dec 16, 2022)

bullittman281 said:


> Hello,
> I'm fighting the same/similar problem. I'm trying to get bhyve to place nice and use it instead of virtualbox. I've gotten the bridge0 and tap0 to create and persist past boot. The entry into /etc/rc.conf is:


I have been using bhyve several years already and use sysutils/vm-bhyve. It is all about scripts. This port is actually a collection of shell scripts.

Doing it all manually may be complex.

For example, for bridges I have on one machine:

```
root@Silicium ~ [1]# vm switch list
NAME      TYPE      IFACE        ADDRESS           PRIVATE  MTU  VLAN  PORTS
internal  standard  vm-internal  192.168.5.113/24  no       -    -     -
public    standard  vm-public    -                 no       -    -     bge0
```

In the rc.conf there is only:

```
vm_enable="YES"
vm_dir="zfs:.../..."

vm_list="..."
```

See: vm(8)

The only problem with these scripts is that IPV6 is not supported and should be configured manually.


----------



## ziomario (Dec 16, 2022)

I don't reccomend vm-bhyve,because it puts you in a little bit different logic than the bhyve inner method of working and if you use it you will learn how this wrapper works,not so much how bhyve works,because the wrapper to work uses its own "method". But here the point is : are you interested to learn ? if yes,what do you want to learn more ? vm-bhyve or bhyve ? or do you want only to make your life easier ?


----------



## ziomario (Dec 16, 2022)

bullittman281 said:


> Hello,
> I'm fighting the same/similar problem. I'm trying to get bhyve to place nice and use it instead of virtualbox. I've gotten the bridge0 and tap0 to create and persist past boot. The entry into /etc/rc.conf is:
> 
> 
> ...



check inside your /etc/sysctl.conf , if you have these lines :


```
net.link.tap.up_on_open=1
net.inet.ip.forwarding=1
net.inet.ip.random_id=1
```


----------



## Argentum (Dec 16, 2022)

ziomario said:


> to learn ? if yes,what do you want to learn more ? vm-bhyve or bhyve ? or do you want only to make your life easier ?


In many cases people want to make their life *easier *an I think they cannot be blamed about that.
Personally, I remember that I started also with a long command line of *bhyve*, manually crating bridge, etc. and soon after that found out that *vm-bhyve* will do most of the work that should be done...


----------



## ziomario (Dec 16, 2022)

At the beginning I tried the wrapper,but I have stopped using it soon. I'm fighting to understand the internal bhyve working method since 2 years now. I've found a lot of bugs and I have helped the developers to improve bhyve. I don't know if I would have been able to help if I used that wrapper. I love the bhyve hypervisor and I want to have a direct approach with it. With the help of the developers I have even created my own shell scripts that work in a different way than the wrapper. For sure not a lot of users would like them. To have the life easier is a temptation,I know,but you will not learn very well how a tool work if you make an abuse of the easy offered by certain tools.


----------



## Argentum (Dec 16, 2022)

ziomario said:


> know if I would have been able to help if I used that wrapper. I love the bhyve hypervisor and I want to have a direct


If you truly love a lady, it doesn't if she is naked or fully dressed...


----------



## ziomario (Dec 16, 2022)

Argentum said:


> If you truly love a lady, it doesn't if she is naked or fully dressed...



I don't love her for sure if she is always dressed or naked


----------



## VladiBG (Dec 17, 2022)

Why do you have "vm_enable" in rc.conf then?


----------



## ziomario (Dec 17, 2022)

It is there since I have used FreeBSD for the first time. Why take it off if it doesn't create problems ?


----------



## xedos832 (Dec 17, 2022)

*where is ifconfig_bridge0="up" and/or  ifconfig_bridge0="addm eth0 addm tap0 addm tap1 ... SYNCDHCP"?* And put *kld_list+="vmm nmdm aio"* in */etc/rc.conf* ,type sysrc *vmm_enable="YES"* and* sysrc nmdm_enable="YES", vm _enable="YES" *isn't correct. If you use VirtualBox need to put *vboxnet_enable="YES"* in your /etc/rc.conf, and create */usr/local/etc/vboxnet/networks.conf*, with : ** aa.bb.cc.dd/24. *if you have *vboxdrv_load="YES"* in your /boot/loader.conf. You need to unload vmm, just type* kldunload vmm*, like root, when you use VirtualBox instead of BHyVE, and viceversa, *kldunload vboxdrv*, they can't work together. you should type ifconfig_tap0="up",and follow for every tapN interfaces you have got.and not "dhcp" or ipv6 . Hald_enable="YES" is't necessary ,there is no more this daemon.If you use *eth0* like interface, where is its configuration?, Sorry, I see only em0, and if you want use it, instead of eth0, add em0 to brigde0. what kind of interface is vtnet0?  you put this in your /etc/rc.conf, in which case you use it? when you need? Which kind of devices you passthrou to bhyve ptdevs="0/2/0 2/0/0 2/0/1 2/0/2 2/0/3" only graphics, or also network adapter and USB?


----------



## ziomario (Dec 17, 2022)

xedos832 said:


> where is ifconfig_bridge0="up" and/or  ifconfig_bridge0="addm eth0 addm tap0 addm tap1 ... SYNCDHCP"? And put kld_list+="vmm nmdm aio" in /etc/rc.conf ,type sysrc vmm_enable="YES" and sysrc nmdm_enable="YES". If you use VirtualBox need to put vboxnet_enable="YES" in your /etc/rc.conf if you have vboxdrv_load="YES" on /boot/loader.conf , but unload vmm, just type kldunload vmm, like root, if you use  it, instead of bhyve, they can't work together. you should type ifconfig_tap0="up",and follow for every tapN interfaces you are,not "dhcp" or ipv6 .hald_enable="YES" is't necessary ,there is no more  this daemon.If you use eth0 like interfaces where is its configuration , sorry I see only em0, and if you want use this instead, add it to brigde0. what kind of interface is vtnet0?  you put this in your /etc/rc.conf in which case you use it? when you need?



Can you format better your message ? it is not understandable at all. Thanks.


----------



## xedos832 (Dec 17, 2022)

What you didn't understand? specifically maybe I have tryed to help for a possibly issues differents by your  target question, but if you look well your /etc/rc.conf /and /boot/loader.conf you see what you have misconfigurated. If you charged vboxdrv_load="YES" in /boot/loader.conf it mean you want use it,and without vbox bridge network interfaces isn't useful. So need to create its configuration. just create with touch /usr/local/etc/vboxnet/network.conf and add: * 192.168.1.100/24 for example.You have cloned_interfaces="bridge0 tap0...eth0 lo1" and eth0 didn't have its specific configuration. Just em0, lo1 is used to create jail specific cloned interface like in bastille tutorial , so need to tipe sysrc cloned_interface+="lo1" , ifconfig_lo1_name="bastille0" and, service netif cloneup. or ifconfig_lo1_name="vtnet0, if you have intention to use it ,like i thought. Maybe your intention is not to use it with jail, but the suggestion is the same. When you use Bhyve, or Virtualbox, you need to reciprocallly unload, vmm or vboxdrv, second by your needs, disable vboxnet to use bhyve and unload vboxdrv ,or viceversa, unload vmm, when you use Virtualbox..So when are both enabled in /boot/loader.conf there is problem.So Maybe should be another problem with your interfaces if you need to passthrou wireless network to bhyve.Anyway need just to configure specific interface if is em0 just type ifconfig_em0="dhcp", if is eth0 ,type config_eth0="dhcp" cloned_interfaces=bridge0 tap0 tapN..." ifconfig_bridge0=" addm em0 addm tap0 adm tapN.. SYNCDHCP" or if you want to name bridge0 with vtnet0, for example: ifconfig_bridge0_name="vtnet0" and ifconfig_vtnet0="addm em0 addm tap0 addm tapN..SYNCDHCP" ,if_tap_enable="YES and if_bridge_enable="YES" then ifconfig_tap0="up" , ifconfig_tapN="up" this for every tap interfaces, where N is the number of this interface. Sorry I hope it is enough clearly now to help you solve your issue


----------



## ziomario (Dec 17, 2022)

xedos832 said:


> what you did't understand? specifically



Everything. Without a proper formatting,It is confused and hard to understand. Fix it.


----------



## Alain De Vos (Dec 17, 2022)

_View: https://www.youtube.com/watch?v=SJUhlRoBL8M_


----------



## xedos832 (Dec 17, 2022)

look there are diffents posts explaining issues about bridge network interfaces with bhyve Configuring bhyve-vm networking . or bhyve bridge networking does not work . Bridged Networking with bhyve and FreeBSD Guests does not work  Bhyve Networking


----------



## bullittman281 (Dec 17, 2022)

ziomario said:


> check inside your /etc/sysctl.conf , if you have these lines :
> 
> 
> ```
> ...


I did not have net.ip.randome=1
I added that to no change. The network will work for one VM, one time, per reboot.
it is using wifi so that may have something to do with it. For what its worth below is the pf.conf config.

```
set skip on lo0
set skip on tap0
nat on bridge0 from any to 192.168.2.0/24 -> (bridg0)
nat on wlan0 from ! wlan0 to any -> (wlan0)

pass quick on bridge0 from any to any
pass quick on re0 from any to any
pass quick on wlan0 all
[CODE]
This was mostly copy and pasted from the wiki for vm-bhyve.
Even with PF disabled tap0 disappears after a vmVM start/stop. After it disappears I cannot recreate a working tap. I can create it and the guest will associate but no traffic will flow. Restarting service won't fix it either. It takes a reboot. Its odd as it seemed to work fine previously but I never paid too close attention. I will try later with a wired connection and see what it does.

Thanks!!
```


----------

