Free weekly email: the week's new posts, videos and one tip from the books, every Sunday. Get it free →
Homelab the Right Way

Home › Posts

Put Servers on Their Own Network Behind OPNsense

Isolate your servers from the house LAN using a dedicated bridge, route them through the firewall, and add a fallback gateway to ensure availability when the firewall VM is down.

· 5 min read · homelabopnsenseproxmoxnetworkingsecurityhigh-availability

Put Servers on Their Own Network Behind OPNsense

Most homelabs end up with OPNsense protecting the guest Wi-Fi while the servers sit on the flat house LAN, wide open to every smart plug and visiting laptop. This setup creates a false sense of security because the firewall cannot inspect or block traffic between your critical services and the rest of your home network. The fix is a dedicated servers network behind the firewall. It adds one worry, though: if the firewall VM dies, do all your services go dark? Not if you build a fallback.

The book opens this chapter by describing a layout where the internet connects to a house router at 192.168.10.1, which sits on a house LAN 192.168.10.0/24. The Proxmox host connects via vmbr0 on this LAN. OPNsense has a WAN interface at 192.168.10.2 on vmbr0 and a new SERVERS interface at 10.30.0.1 on vmbr1. The servers themselves live in the 10.30.0.0/24 subnet, with application containers assigned static IPs like .10, .11, and .12.

vmbr1 is a Linux bridge on the Proxmox host. It needs no physical port if all your servers are on the same host, and you can add a port or a VLAN later for a second host. The following steps walk you through building this isolation layer, routing traffic correctly, and ensuring that your services stay online even when the firewall is offline.

Trap 1: Leaving servers on the house LAN

The most common mistake is assuming that having a firewall is enough protection if the servers share the same broadcast domain as your personal devices. When servers sit on the flat house LAN, they are exposed to every smart plug and visiting laptop. This means that if one device is compromised, the attacker has direct layer-2 access to your database containers and management interfaces.

The solution is to create a separate network segment for these services. You must build vmbr1 as a dedicated bridge on the Proxmox host. This isolates server traffic from the general house LAN traffic at the switch level, forcing all communication through the firewall where you can apply policies.

To implement this, add the bridge in System → Network, or directly in /etc/network/interfaces. The configuration requires specific bridge settings to ensure it functions correctly without a physical port attached:

auto vmbr1
iface vmbr1 inet manual
    bridge-ports none
    bridge-stp off
    bridge-fd 0
#servers network (gateway lives in OPNsense)

Apply these changes immediately with ifreload -a. Once the bridge exists, you must give the OPNsense VM a new NIC on vmbr1. In OPNsense, assign this interface as SERVERS, with static IPv4 10.30.0.1/24. You should enable DHCP if you prefer dynamic assignment, but the book recommends using static IPs for servers to ensure predictable addresses.

Trap 2: Routing servers through the wrong gateway or VPN

Once the network segment exists, you must decide how traffic leaves it. If your firewall sends some networks through a VPN, you need to explicitly define where servers go. Most servers should exit on your home IP rather than through a corporate or remote VPN tunnel. Sending server traffic through a VPN can introduce latency, break local service discovery, and complicate NAT rules unnecessarily.

On the SERVERS interface in OPNsense, add a Pass rule with source SERVERS net and destination any. Crucially, set the gateway to WAN, which is the plain WAN gateway, not the VPN gateway. Place this rule above any VPN policy rules so it takes precedence. In Outbound NAT, ensure that SERVERS net is NATed out via WAN.

You also need to control access from the house LAN. Block SERVERS → GUEST traffic entirely unless you have a specific reason otherwise. Allow only the specific house-LAN access you need, such as your desktop accessing the servers' web UIs. Additionally, add SERVERS to Suricata's interface list so that server traffic receives the same Intrusion Detection System (IDS) coverage as other networks.

Trap 3: Moving all guests at once without a transition plan

When you move services to the new network, changing a container's network blips its connection for a few seconds. If you migrate everything simultaneously, you risk cascading failures and losing track of which service is broken. The book advises moving one guest at a time to verify connectivity before proceeding.

For a Proxmox container, set a new NIC on vmbr1 with a static IP and the gateway pointing to the OPNsense SERVERS interface:

pct set 120 --net0 name=eth0,bridge=vmbr1,ip=10.30.0.20/24,gw=10.30.0.1

Verify the configuration from inside the guest by checking the route and testing connectivity to the gateway:

pct exec 120 -- sh -c 'ip route; ping -c2 10.30.0.1'

Then confirm that the container sees your home public IP, ensuring it is routing out correctly:

pct exec 120 -- curl -s https://ifconfig.me; echo

The curl command should print your home public IP. Check the service itself from a client machine, then move on to the next guest. To avoid breaking everything that points at a guest's old address, keep the old IP as a secondary for a transition period, or update DNS and reverse proxy entries in the same sitting. Make a table of old IP → new IP before you begin.

Trap 4: Ignoring house LAN reachability and single points of failure

After moving guests, clients on the house LAN will no longer be able to reach the servers because they do not know how to route to 10.30.0.0/24. You must tell the house router about this new subnet. The clean way is to add a static route on the house router: 10.30.0.0/24 via 192.168.10.2, which is the OPNsense WAN address.

Then, allow the house LAN in on OPNsense's WAN interface for the specific ports you need. Disable Block private networks on WAN, since your "WAN" is actually a private network in this topology.

However, if OPNsense stops, every server loses its gateway. To prevent this single point of failure, implement a fallback gateway. A small watchdog script on the Proxmox host can take over the gateway address 10.30.0.1 until OPNsense comes back. The host is already on both bridges, so it can route the servers straight out to the house router.

The script probes the OPNsense WAN address (192.168.10.2) to determine health. If it fails five times (about 10-15 seconds), the host takes over the gateway address using ip addr add, sets up MASQUERADE for NAT, and sends an ARP update. When OPNsense recovers and passes ten good probes, the host hands back control. Note that you must probe a different address than the one you take over; if the watchdog pinged 10.30.0.1, it would end up pinging itself once it held the address.

In fallback mode, servers skip the firewall and the IPS. This is the trade-off you are choosing: availability over inspection for the length of an outage. If that is not acceptable for some service, leave it on the OPNsense-only path. Test this by running ping 1.1.1.1 continuously from a test container, then unplugging OPNsense's SERVERS NIC in Proxmox. You should lose a few pings, see TAKEOVER in journalctl -t gw-watchdog, and keep going. Reconnect and watch for HANDBACK.

Checklist: servers network

  • vmbr1 created; OPNsense SERVERS interface at 10.30.0.1
  • SERVERS exits via WAN (not VPN), NAT confirmed, IDS watching it
  • Old IP → new IP table written; DNS, reverse proxy and integrations updated
  • House router has a static route to the servers subnet
  • Watchdog service installed and tested by disconnecting OPNsense
  • PBX, management and remote hosts deliberately left where they are

More articles