Open alexmihajlov opened 3 years ago
You should add you physical interface to this bridge like that: vm switch add public <you-if-name>
. It's mentioned in Quickstart: https://github.com/churchers/vm-bhyve/wiki/Quickstart
Some more virtual switches info: https://github.com/churchers/vm-bhyve/wiki/Virtual-Switches
Since bridge does not work with wlan interfaces, I use nat from this documentation https://github.com/churchers/vm-bhyve/wiki/NAT-Configuration
Ok, so this may be different problem. I have never used this setup so maybe @churchers could chime in.
Hi all!
I can confirm this issue. Following the steps mentioned in [1], both when starting the VM and when shutting it down, the IP of the bridge is lost and it is necessary to execute again vm switch address public <IP>
.
But I'm not sure if this is a vm-bhyve
bug or just a Bhyve feature because I've noticed similar behavior using the /usr/share/examples/bhyve/vmrun.sh
script. In this case I have used the procedure described in [2] in the order indicated and every time I start the virtual machine some network configurations are lost so I am forced to manually execute again:
# ifconfig bridge0 inet 10.0.4.1/24 up
# sysctl net.inet.ip.forwarding=1
net.inet.ip.forwarding: 0 -> 1
[1] https://github.com/churchers/vm-bhyve/wiki/NAT-Configuration [2] https://adventurist.me/posts/00304
I question why you would even want an IP address on the bridge, just adding your 10 gigabit ethernet card to it, and letting vm-bhyve handle adding tap devices to it should be enough. Vlans should be handled on the switch itself as I've never seen a point to do a software vlan with virtualized guests.
Me-too comment. As soon as the vm is started, bridge's IP address is gone, and guests's access to the network with it, Once added again via vm switch address public <IP/mask>
everything is back to normal.
As per "why you would even want an IP address on the bridge" I am running this vm on a gateway already full of NICs and want an isolated network, why add hardware when you don't have to?
I will show you how I do it where I don't have any problems with IPV6 or anything making sure bridge has auto_linklocal set. I try to keep it standard with br0 so when going back between KVM on Linux with virsh on older hosts that don't support bhyve and FreeBSD it has some similarities. I really suggest you do it this way as the FreeBSD handbook suggests always assigning IP to the bridge then adding devices, also if you change your networking config to use say a lag0 port at some point its just a simple change in /etc/rc.conf instead:
/etc/rc.conf:
#let vm-bhyve create tap devices instead so they get destroyed when not in use
cloned_interfaces="bridge0"
ifconfig_br0="addm ix0 up description services"
ifconfig_bridge0_name="br0"
ifconfig_br0_alias0="inet 192.168.0.1 netmask 255.255.255.0"
ifconfig_br0_ipv6="inet6 fc00:192:168:1::1/64 accept_rtadv auto_linklocal"
ifconfig_ix0="up -rxcsum -tso -txcsum -lro -vlanhwtso"
vm switch create -t manual -b br0 services
loader="uefi"
#graphics="yes"
xhci_mouse="yes"
cpu=8
cpu_sockets=2
cpu_cores=4
memory=8G
network0_type="virtio-net"
network0_switch="services"
#change to "nvme" if we get better server
disk0_type="virtio-blk"
disk0_name="disk0.img"
uuid="5caa73a4-72de-11ed-83f8-e4534bf64f00"
network0_mac="58:9c:fc:0a:18:2d"
@syleishere thanks you. this plus dnsmasq got my vm getting an ip
I am using 13.0-RELEASE-p4 and vm-bhyve v1.4.2 (rev. 104002)
When starting the system the bridge interface vm-public is up with an ip address of 192.168.8.1
Switch settings:
When I start the virtual machine with the config
ip address is missing on the vm-public interface
and I cannot connect to my vm. I have to add the address manually. How can this be fixed?