There is good answer above, so here is how I set up vm-bhyve servers.
Note, this setup are using VLANs for all networks
The config in
/etc/rc.conf depends on you setup. I use a lot of VLANs, so here at two setups.
This one is simple and just on one interface. It’s used for ssh to the server, default GW and transporting VLANs etc. (non direct vm server data)
Code:
cloned_interfaces="vlan65"
ifconfig_ix0="up mtu 9000 -rxcsum -txcsum -tso -lro"
ifconfig_vlan65="inet 10.65.1.20 netmask 255.255.255.0 vlan 65 vlandev ix0 mtu 9000"
defaultrouter="10.65.1.5"
But I use LACP on two interfaces, so the config is title different. Again, it’s used for ssh to the server, default GW and transporting VLANs etc. (non direct vm server data)
Code:
cloned_interfaces="lagg0 vlan65"
ifconfig_ix0="up mtu 9000 -rxcsum -txcsum -tso -lro"
ifconfig_ix1="up mtu 9000 -rxcsum -txcsum -tso -lro"
ifconfig_lagg0="laggproto lacp laggport ix0 laggport ix1 up"
ifconfig_vlan65="inet 10.65.1.20 netmask 255.255.255.0 vlan 65 vlandev lagg0 mtu 9000"
defaultrouter="10.65.1.5"
When I install vm-bhyve and vm-switch I use a lot of VLANs for the vm-servers and make them with:
# vm switch create -n 166 -m 9000 -i ix0 vlan166
or
# vm switch create -n 166 -m 9000 -i lagg0 vlan166
One for every VLAN. Above make VLAN 166 for ix0 or lagg0.
Then in
/vm/SERVER/SERVER.conf for the vm-servers I have two networks rows:
Code:
network0_type="virtio-net"
network0_switch="vlan166"
That’s it!
Vm-bhyve makes all the networks, TAP interface etc.
It’s just works out of the box.