VM in TrueNAS is not accessible from the local network, only from the TrueNAS host (with exceptions))

Problem Description:

I have created a virtual machine (VM) inside TrueNAS and configured it with a static IP in the range of my local network (192.168.0.0/24). The VM is assigned the IP 192.168.0.24, with the gateway set to 192.168.0.1 (the router), and the subnet mask 255.255.255.0. However, I am encountering the following issue:

  • The VM is only accessible from the TrueNAS host (which has IP 192.168.0.26).
  • It is not accessible from other devices on the local network (neither from other computers nor from the router).
  • If I change the VM’s gateway to the TrueNAS host’s IP (192.168.0.26), the VM becomes accessible from other devices on the network, but this is not the desired configuration, as the VM should have direct access to the network through the router (without depending on the TrueNAS host).

Network Configuration:

  • TrueNAS Host:
    • IP: 192.168.0.26
    • Connected to the router with IP 192.168.0.1 (network 192.168.0.0/24).
  • VM in TrueNAS:
    • Static IP: 192.168.0.24
    • Gateway: 192.168.0.1 (router)
    • Subnet mask: 255.255.255.0
  • VM Network Interface:
    • Configured with a bridged network (using the TrueNAS host’s physical interface).

Observed Behavior:

  • The VM is accessible from the TrueNAS host without issues.
  • From other devices on the network (on the 192.168.0.0/24 range), I cannot ping the VM (IP 192.168.0.24).
  • If I configure the gateway of the VM as the TrueNAS host’s IP (192.168.0.26), the VM becomes accessible from the local network, but this is not the intended configuration.

Steps Already Taken:

I have followed these steps to try to resolve the issue, but the problem persists:

  1. Verified the bridge configuration in TrueNAS:
  • The bridge is configured correctly to use the TrueNAS host’s physical interface connected to the router.
  • The bridge interface itself does not have an IP assigned in TrueNAS (which is correct).
  1. Verified the VM’s configuration:
  • The VM has the correct static IP (192.168.0.24), the correct subnet mask (255.255.255.0), and the gateway set to 192.168.0.1 (the router).
  1. Enabled IP forwarding on TrueNAS:
  • I enabled IP forwarding (sysctl net.inet.ip.forwarding=1), but the VM is still not accessible from the network.
  1. Checked the routes in the VM:
  • In the VM, the default route (default route) is correctly set to the gateway (192.168.0.1).

Question:

Has anyone experienced a similar issue when trying to make a VM in TrueNAS directly accessible from the local network without relying on the TrueNAS host as the gateway?

Any suggestions or solutions would be greatly appreciated.