churchers/vm-bhyve

A network restart is leading missing IP address on vm-public

Opened this issue · 6 comments

Hi,

I've figured our that service netif restart removes IP address from the vm-public interface, and there's no way (except the manual one) to assign IP address to the interface back, i.e.:

# ifconfig vm-public inet 10.0.0.1/24

Would that be good idea to move vm-public initialization to /etc/rc.conf and make that explicitly.

As a workaround one's can create bridge interface with /etc/rc.conf and make vm's switch of type manual.

As a workaround one's can create bridge interface with /etc/rc.conf and make vm's switch of type manual.

Just to make that a bit more clear, so /etc/rc.conf records should be something like the following:

cloned_interfaces="vm-public"
ifconfig_vm-public="addm wlan0" # change the interface's name on your taste
config_vm-public="inet 10.0.1.1/24 up"

Is there anything needs to add/change in /vm/.config/system.conf file?

Something like this in /etc/rc.conf:

cloned_interfaces="bridge0"
ifconfig_bridge0="addm wlan0 name vm-public 10.0.1.1/24" # change the interface's name on your taste
ifconfig_wlan0="up"

and then
# vm switch create -t manual -b vm-public vm-public

Something like this in /etc/rc.conf:

cloned_interfaces="bridge0"
ifconfig_bridge0="addm wlan0 name vm-public 10.0.1.1/24" # change the interface's name on your taste
ifconfig_wlan0="up"

and then # vm switch create -t manual -b vm-public vm-public

That doesn't work. Also, it would be great to avoid using - symbol in the network interfaces names. Would that be good idea to rename vm-public to vmpublic0 or so?

Also, it would be great to avoid using - symbol in the network interfaces names. Would that be good idea to rename vm-public to vmpublic0 or so?

Generally speaking if you need to configure vm-public0 network interface in /etc/rc.conf it must be present as vm_public0, for example:
ifconfig_vm_public0="DHCP"

This configuration works for me:

cloned_interfaces="bridge0"
create_args_bridge0="link 58:9c:fc:b1:dc:6d"
ifconfig_bridge0="192.168.254.1/27 name vm-LAN"

Also, it would be great to avoid using - symbol in the network interfaces names. Would that be good idea to rename vm-public to vmpublic0 or so?

Generally speaking if you need to configure vm-public0 network interface in /etc/rc.conf it must be present as vm_public0, for example: ifconfig_vm_public0="DHCP"

This configuration works for me:

cloned_interfaces="bridge0"
create_args_bridge0="link 58:9c:fc:b1:dc:6d"
ifconfig_bridge0="192.168.254.1/27 name vm-LAN"

Thanks. I've decided to use bridge0 interface name in the vm-bhyve configuration files.