I'm currently playing around with bhyve for the first time and am trying to setup networking. My objective is to have this bhyve instance live in its own network concealed within my machine and use the host for reaching the outside world.
This is what I have so far:
I have configured my pf.conf as follows:
And then I start my vm with as follows:
And then this is about where I get lost. I can connect to the VM through VNC and it boots successfully, but then it has no network connection. My intention was to set everything statically... which I think I'm supposed to do within the VM's OS? Trying to do so doesn't fix anything (by which I mean setting a static IP of 172.77.15.2 with 172.77.15.1 as the default gateway). I feel like I'm probably missing a lot.
Could someone help me out by walking me through the configuration I should be using to set up what I want? Thanks!
This is what I have so far:
Code:
# Create the bridge.
ifconfig bridge create
ifconfig bridge0 name vswitch
iconfig vswitch up
ifconfig vswitch addm em0
ifconfig vswitch inet 172.77.15.1/24
# Create the tap interface.
ifconfig tap0 create
ifconfig vswitch addm tap0
Code:
vms_network="172.77.15.1/24"
...
nat on em0 from $vms_network to any -> (em0)
...
And then I start my vm with as follows:
Code:
sudo bhyve -c 2 -m 4G -w -H \
-s 0,hostbridge \
-s 3,ahci-cd,/somewhere/on/disk/archlinux-2021.07.01-x86_64.iso \
-s 4,virtio-blk,/dev/zvol/pool-1/bhyve/vms/arch \
-s 5,virtio-net,tap0 \
-s 29,fbuf,tcp=0.0.0.0:5900,w=1920,h=1080,wait \
-s 30,xhci,tablet \
-s 31,lpc -l com1,stdio \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \
arch
And then this is about where I get lost. I can connect to the VM through VNC and it boots successfully, but then it has no network connection. My intention was to set everything statically... which I think I'm supposed to do within the VM's OS? Trying to do so doesn't fix anything (by which I mean setting a static IP of 172.77.15.2 with 172.77.15.1 as the default gateway). I feel like I'm probably missing a lot.
Could someone help me out by walking me through the configuration I should be using to set up what I want? Thanks!