Like
@LarsR mentioned you need a bridge.
To set up the bridge for your main interface correctly from the WebGUI you need to follow specific order of steps to not loose connectivity:
- Set up your main interface with static IP by disabling DHCP and adding IP alias (use the same IP you are connected to for easy results)
- Test Changes and then Save them (important)
- Edit your main interface, remove the alias IP
- Don't click Test Changes
- Add a bridge, name it something like br0, select your main interface as a member and add the IP alias that you had on main interface
- Click Apply and then Test Changes
- It will take longer to apply than just setting static IP, you can even get a screen telling you that your NAS in offline but just wait - worst case scenario TrueNas will revert to old network settings.
- After 30sec you should see an option to save changes.
- After you save them you should see both your main interface and new bridge active but bridge should have the IP
Now you just assign the bridge as an interface for your VM.