OpenWrt Virtual Router
v1.2.14
Progress
NETWORK FOUNDATION

Build Steps

Build the OpenWrt network foundation before Proxmox Backup Server.

Create the Internal Networks

STEP 000 — Optional: import previous P2V context

DO: If you completed Windows 11 → Proxmox, import p2v-windows-11-state.json. Otherwise skip this step.

Optional previous-guide context

Imports saved values and diagnostic evidence only. It does not complete this guide.

Optional — skip if unavailable.

STOP CHECK: Previous context is loaded, or this optional step was skipped.

STEP 000a

Troubleshoot STEP 000
Context
No files attached. Diagnostics can include readable text/log files; other files are listed by name.

STEP 001 — Discover WAN and choose the internal subnets

DO: Open the PVE web interface https://{{PROXMOX_IP}}:8006

In PVE → Node → Shell, run:

PVE_CURRENT_CIDR=$(ip -4 -o addr show dev vmbr0 | awk 'NR==1{print $4}')
ISP_SUBNET_CIDR=$(ip -4 route show dev vmbr0 scope link | awk '$1 ~ /^[0-9]+\./ && $1 ~ /\// {print $1; exit}')
PVE_PHYSICAL_NIC=$(for path in /sys/class/net/vmbr0/brif/*; do [ -e "$path" ] || continue; nic=${path##*/}; [ -e "/sys/class/net/$nic/device" ] && { echo "$nic"; break; }; done)
printf 'PVE_CURRENT_CIDR=%s\nISP_SUBNET_CIDR=%s\nPVE_PHYSICAL_NIC=%s\n' "$PVE_CURRENT_CIDR" "$ISP_SUBNET_CIDR" "$PVE_PHYSICAL_NIC"

Copy the three output lines. Click the field below and press Ctrl+V. It analyzes automatically.

Click the field and press Ctrl+V. Analysis runs automatically.

Detected configuration

Choose the two internal networks. OpenWrt automatically uses the first usable IP in each subnet. Bridge names are automatic: the subnet third octet becomes the bridge number (10.0.5.0/24 → vmbr5).

Build values

Final layout:

vmbr0  WAN       physical {{PVE_PHYSICAL_NIC}}  ISP {{ISP_SUBNET_CIDR}}
{{TRUSTED_BRIDGE}}  Trusted   no physical port               {{TRUSTED_CIDR}}
{{DMZ_BRIDGE}}  DMZ       no physical port               {{DMZ_CIDR}}

OpenWrt WAN      vmbr0  DHCP from ISP router
OpenWrt Trusted  {{TRUSTED_BRIDGE}}  {{OPENWRT_TRUSTED_CIDR}}
OpenWrt DMZ      {{DMZ_BRIDGE}}  {{OPENWRT_DMZ_CIDR}}

STOP CHECK: Enter valid Trusted, PVE and DMZ values. Only vmbr0 touches the physical NIC.

STEP 001a

Troubleshoot STEP 001
Context
No files attached. Diagnostics can include readable text/log files; other files are listed by name.

STEP 002 — Back up the current PVE network

DO: In PVE → Node → Shell:

cp /etc/network/interfaces /root/interfaces.before-openwrt
cat /etc/network/interfaces

STOP CHECK: /root/interfaces.before-openwrt exists.

STEP 002a

Troubleshoot STEP 002
Context
No files attached. Diagnostics can include readable text/log files; other files are listed by name.

STEP 003 — Create the isolated Trusted and DMZ bridges

DO: In PVE → Node → System → Network create:

{{TRUSTED_BRIDGE}} — Trusted

IPv4/CIDR:    {{PVE_TRUSTED_CIDR}}
Gateway:      blank
Bridge ports: blank
VLAN aware:   off
Autostart:    on

{{DMZ_BRIDGE}} — DMZ

IPv4/CIDR:    blank
Gateway:      blank
Bridge ports: blank
VLAN aware:   off
Autostart:    on

Apply Configuration. Leave vmbr0 unchanged for now.

Verify in the PVE shell:

ip -4 -br addr show {{TRUSTED_BRIDGE}}
ip -4 -br addr show {{DMZ_BRIDGE}}
bridge link

STOP CHECK: {{TRUSTED_BRIDGE}} has {{PVE_TRUSTED_CIDR}}; {{DMZ_BRIDGE}} has no PVE IPv4 address; neither bridge has a physical port.

STEP 003a

Troubleshoot STEP 003
Context
No files attached. Diagnostics can include readable text/log files; other files are listed by name.

Build OpenWrt

STEP 004 — Create the OpenWrt VM

DO: Review the Community Scripts OpenWrt VM source before running it.

SCRIPT SAFETY: curl | bash runs remote code as root. Run only code you trust.

In PVE → Node → Shell:

bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/vm/openwrt-vm.sh)"

Use Advanced settings and leave the VM stopped:

VMID:       {{OPENWRT_VMID}}
CPU:        1
RAM:        256 MiB or more
Disk:       1 GiB
LAN bridge: {{TRUSTED_BRIDGE}}
LAN IP:     {{OPENWRT_TRUSTED_IP}}
Netmask:    /{{TRUSTED_PREFIX}}
LAN VLAN:   blank
WAN bridge: vmbr0
WAN VLAN:   blank
WAN:        DHCP
Start VM:   No
net0 / eth0 = Trusted
net1 / eth1 = WAN

STOP CHECK: Trusted uses {{TRUSTED_BRIDGE}}; WAN uses vmbr0; neither NIC has a VLAN tag.

STEP 004a

Troubleshoot STEP 004
Context
No files attached. Diagnostics can include readable text/log files; other files are listed by name.

STEP 005 — Add the DMZ NIC and startup order

DO: With OpenWrt stopped, use VM → Hardware → Add → Network Device:

Bridge:    {{DMZ_BRIDGE}}
Model:     VirtIO
VLAN Tag:  blank

In VM → Options:

Start at boot:         Yes
Start/Shutdown order:  1
Startup delay:         30 seconds

If the Windows admin VM starts automatically, set its Start/Shutdown order to 2.

Start OpenWrt.

net0 = Trusted / {{TRUSTED_BRIDGE}}
net1 = WAN / vmbr0
net2 = DMZ / {{DMZ_BRIDGE}}

STOP CHECK: OpenWrt is running with three untagged VirtIO NICs on three separate bridges.

STEP 005a

Troubleshoot STEP 005
Context
No files attached. Diagnostics can include readable text/log files; other files are listed by name.

STEP 006 — Connect the Windows admin VM and secure LuCI

DO: Keep the Windows VM's current NIC during cutover. Add a second VirtIO NIC:

Bridge:    {{TRUSTED_BRIDGE}}
VLAN Tag:  blank

Do not enable Windows Internet Connection Sharing or network bridging.

Start/reboot Windows. The new NIC should receive an address from {{TRUSTED_CIDR}}.

Open:

http://{{OPENWRT_TRUSTED_IP}}
https://{{PVE_TRUSTED_IP}}:8006

In LuCI:

  1. Sign in as root.
  2. System → Administration → Router Password → set a strong password.
  3. System → Administration → HTTP(S) Access → enable Redirect to HTTPS → Save & Apply.
  4. Reopen https://{{OPENWRT_TRUSTED_IP}} and accept the self-signed certificate warning.
  5. Network → Interfaces → confirm WAN received a private ISP-LAN address.

ISP-side OpenWrt address

If supported, reserve {{OPENWRT_WAN_IP}} for the OpenWrt WAN MAC on the ISP router.

STOP CHECK: HTTPS LuCI and PVE both open from the Windows VM over {{TRUSTED_BRIDGE}}.

STEP 006a

Troubleshoot STEP 006
Context
No files attached. Diagnostics can include readable text/log files; other files are listed by name.

STEP 007 — Configure Trusted

DO: In LuCI → Network → Interfaces → LAN, confirm:

Protocol:  Static address
Device:    eth0
IPv4/CIDR: {{OPENWRT_TRUSTED_CIDR}}

Under DHCP Server, enable DHCP and use an unused pool inside {{TRUSTED_CIDR}}. Keep a 12h lease unless you need another value.

Under IPv6 Settings, disable RA, DHCPv6, and NDP proxy for this IPv4-only guide.

Keep LAN in the lan firewall zone. Save & Apply.

STOP CHECK: The Windows Trusted NIC receives an address inside {{TRUSTED_CIDR}}; HTTPS LuCI and PVE still work.

STEP 007a

Troubleshoot STEP 007
Context
No files attached. Diagnostics can include readable text/log files; other files are listed by name.

STEP 008 — Configure DMZ without DHCP

DO: In LuCI → Network → Interfaces → Add new interface:

Name:      dmz
Protocol:  Static address
Device:    eth2
IPv4/CIDR: {{OPENWRT_DMZ_CIDR}}
  1. DHCP Server → enable Ignore interface.
  2. IPv6 Settings → disable RA, DHCPv6, and NDP proxy.
  3. Firewall Settings → create or assign the dmz zone.
  4. Save & Apply.

STOP CHECK: DMZ uses {{OPENWRT_DMZ_IP}} inside {{DMZ_CIDR}} with no DHCPv4, RA, or DHCPv6 service.

STEP 008a

Troubleshoot STEP 008
Context
No files attached. Diagnostics can include readable text/log files; other files are listed by name.

STEP 009 — Apply the firewall policy

DO: Open LuCI → Network → Firewall → General Settings.

lan — Trusted

Input:       ACCEPT
Output:      ACCEPT
Forward:     REJECT
Masquerade:  off
Covered:     lan
Forward to:  wan only

dmz

Input:       REJECT
Output:      ACCEPT
Forward:     REJECT
Masquerade:  off
Covered:     dmz
Forward to:  wan only

wan

Keep normal WAN defaults:

Input:       REJECT
Output:      ACCEPT
Forward:     REJECT
Masquerade:  on
Forward to:  none

Do not add inter-zone forwarding, DMZ input exceptions, or WAN port forwards during the baseline setup. DMZ clients use static addresses and external DNS.

STOP CHECK: Only Trusted → WAN and DMZ → WAN forwarding exists.

STEP 009a

Troubleshoot STEP 009
Context
No files attached. Diagnostics can include readable text/log files; other files are listed by name.

Cut Over and Verify

STEP 010 — Move PVE management fully to Trusted

DO: Before changing PVE, confirm from the Windows Trusted NIC:

https://{{OPENWRT_TRUSTED_IP}}
https://{{PVE_TRUSTED_IP}}:8006

LOCKOUT CHECK: Continue only if you can still reach the Windows admin VM after its old ISP-LAN NIC is removed or disabled. Use local/KVM/out-of-band access if needed.

Then:

  1. Remove or disable the Windows VM's old vmbr0 NIC. Leave only {{TRUSTED_BRIDGE}}.
  2. Move any other non-WAN VM/LXC NICs off vmbr0. Only OpenWrt WAN should remain there.
  3. In PVE → Node → System → Network, edit vmbr0 → remove its PVE IPv4/CIDR and gateway. Keep {{PVE_PHYSICAL_NIC}} as its only bridge port.
  4. Edit {{TRUSTED_BRIDGE}} → keep {{PVE_TRUSTED_CIDR}} and set Gateway {{OPENWRT_TRUSTED_IP}}.
  5. Keep {{DMZ_BRIDGE}} with no PVE address or gateway.
  6. Apply Configuration.

Final host layout:

vmbr0  WAN       physical port {{PVE_PHYSICAL_NIC}}  PVE IP: none
{{TRUSTED_BRIDGE}}  Trusted   physical port none                  PVE IP: {{PVE_TRUSTED_CIDR}}
{{DMZ_BRIDGE}}  DMZ       physical port none                  PVE IP: none
Default gateway: {{OPENWRT_TRUSTED_IP}}

After this cutover, direct PVE access from the ISP LAN is intentionally gone.

STOP CHECK: PVE is reachable only through Trusted or out-of-band access.

STEP 010a

Troubleshoot STEP 010
Context
No files attached. Diagnostics can include readable text/log files; other files are listed by name.

STEP 011 — Remove PVE IPv6 exposure from WAN and DMZ

DO: This guide is IPv4-only. In PVE → Node → Shell:

printf '%s\n' \
  'net.ipv6.conf.{{PVE_PHYSICAL_NIC}}.disable_ipv6 = 1' \
  'net.ipv6.conf.vmbr0.disable_ipv6 = 1' \
  'net.ipv6.conf.{{DMZ_BRIDGE}}.disable_ipv6 = 1' \
| tee /etc/sysctl.d/99-pve-openwrt-isolation.conf
sysctl -p /etc/sysctl.d/99-pve-openwrt-isolation.conf

Verify:

ip -6 -br addr show dev {{PVE_PHYSICAL_NIC}}
ip -6 -br addr show dev vmbr0
ip -6 -br addr show dev {{DMZ_BRIDGE}}

STOP CHECK: PVE has no IPv6 address on the physical WAN NIC, vmbr0, or {{DMZ_BRIDGE}}.

STEP 011a

Troubleshoot STEP 011
Context
No files attached. Diagnostics can include readable text/log files; other files are listed by name.

STEP 012 — Create a Debian 13 DMZ LXC and verify isolation

DO: Choose an unused IP inside {{DMZ_CIDR}} for this LXC. Do not use the OpenWrt DMZ address {{OPENWRT_DMZ_IP}}.

This LXC can be reused later as the WireGuard VPN aggregator. Suggested hostname: dmz-wg01; suggested CTID: 101.

DMZ LXC values

In PVE:

  1. local → CT Templates → Templates → download Debian 13 standard if needed.
  2. Create CT:
  • CT ID: {{DMZ_LXC_CTID}}
  • Hostname: {{DMZ_LXC_HOSTNAME}}
  • Unprivileged: Yes
  • Disk: 4 GiB
  • CPU: 1 core
  • Memory: 512 MiB
  • Bridge: {{DMZ_BRIDGE}}
  • IPv4: Static → {{DMZ_LXC_IP}}/{{DMZ_PREFIX}}
  • Gateway: {{OPENWRT_DMZ_IP}}
  • DNS: 1.1.1.1
  1. Start the LXC and open Console.

Verify Internet access:

ping -c 4 1.1.1.1

Expected: replies received.

Verify LuCI TCP 443 is blocked from DMZ. The first check installs curl in the Debian LXC, then tests the HTTPS port:

apt-get update
apt-get install -y curl
curl -ksS --connect-timeout 3 --max-time 3 -o /dev/null https://{{OPENWRT_DMZ_IP}}:443/ && echo 'FAIL: LuCI 443 is reachable' || echo 'PASS: LuCI 443 is blocked'

Verify PVE TCP 8006 is blocked from DMZ:

curl -ksS --connect-timeout 3 --max-time 3 -o /dev/null https://{{PVE_TRUSTED_IP}}:8006/ && echo 'FAIL: PVE 8006 is reachable' || echo 'PASS: PVE 8006 is blocked'

Expected:

Internet        PASS
LuCI :443       BLOCKED
PVE :8006       BLOCKED

Prove DMZ traffic does not leak onto the physical NIC

On PVE, run while the LXC is pinging 1.1.1.1:

tcpdump -eni {{PVE_PHYSICAL_NIC}} 'ether proto 0x8100 or net {{TRUSTED_CIDR}} or net {{DMZ_CIDR}}'

Stop with Ctrl+C.

Expected: no matches. Only OpenWrt's NATed WAN traffic leaves the physical NIC.

STOP CHECK: DMZ has Internet access, cannot reach LuCI or PVE management, and does not leak onto the physical NIC.

STEP 012a

Troubleshoot STEP 012
Context
No files attached. Diagnostics can include readable text/log files; other files are listed by name.

STEP 013 — Save the recovery state

DO: In LuCI open System → Backup / Flash Firmware → Backup → Generate archive. Save the .tar.gz, then attach it below.

In PVE → Node → Shell create a small recovery bundle:

mkdir -p /root/openwrt-foundation-recovery
cp /etc/network/interfaces /root/openwrt-foundation-recovery/interfaces
cp /etc/sysctl.d/99-pve-openwrt-isolation.conf /root/openwrt-foundation-recovery/
qm config {{OPENWRT_VMID}} | tee /root/openwrt-foundation-recovery/openwrt-vm.conf
qm config {{WINDOWS_VM_VMID}} | tee /root/openwrt-foundation-recovery/windows-admin-vm.conf
ip -4 -br addr | tee /root/openwrt-foundation-recovery/ip-addresses.txt
ip route | tee /root/openwrt-foundation-recovery/ip-routes.txt
bridge link | tee /root/openwrt-foundation-recovery/bridge-links.txt
tar -czf /root/pve-network-recovery.tar.gz -C /root openwrt-foundation-recovery

From Windows PowerShell, copy the bundle (replace root if you use another PVE SSH admin):

scp root@{{PVE_TRUSTED_IP}}:/root/pve-network-recovery.tar.gz .

Then attach it:

Then:

  1. Saved State → Saved State Security… → Password protect and encrypt.
  2. Saved State → Export Saved State.
  3. Store the .encrypted.dgstate off-host.

Final state:

  • vmbr0 is WAN only, is the only bridge with a physical port, and only OpenWrt WAN remains attached as an internal guest.
  • Trusted {{TRUSTED_CIDR}} is isolated on {{TRUSTED_BRIDGE}}.
  • DMZ {{DMZ_CIDR}} is isolated on {{DMZ_BRIDGE}} with no DHCP/RA service.
  • PVE management exists only on Trusted.
  • Trusted and DMZ forward only to WAN and cannot reach each other.
  • DMZ cannot reach PVE or LuCI.
  • No permanent WAN port forwards exist; Step 014 is an optional source-restricted temporary exception.
  • OpenWrt starts first at boot.
  • OpenWrt and PVE recovery bundles are inside the encrypted Saved State.

STOP CHECK: The network foundation and encrypted recovery state are complete.

STEP 013a

Troubleshoot STEP 013
Context
No files attached. Diagnostics can include readable text/log files; other files are listed by name.

STEP 014 — Optional: Temporary PVE management exception

Until WireGuard management through the DMZ is available, PVE is not reachable from the ISP-router-side LAN.

Use this only if OpenWrt WAN has a private ISP-LAN address and the ISP router is not forwarding TCP 8006 from the Internet. Never expose PVE TCP 8006 directly to the public Internet.

In LuCI at https://{{OPENWRT_TRUSTED_IP}}, create a temporary port forward:

Name: Temporary PVE management
Protocol: TCP
Source Zone: wan
Source IP address: your admin device's current IP on {{ISP_SUBNET_CIDR}}
External port: 8006
Destination Zone: lan
Internal IP address: {{PVE_TRUSTED_IP}}
Internal port: 8006

In the rule's Advanced Settings, set Source IP address to that one admin device; do not leave it unrestricted.

Test from that ISP-router-side admin device, not from Trusted:

https://{{OPENWRT_WAN_IP}}:8006

When WireGuard management is working, delete this temporary port forward.

STOP CHECK: From the source-restricted ISP-LAN admin device, PVE is reachable at https://{{OPENWRT_WAN_IP}}:8006, and the ISP router has no Internet-facing TCP 8006 forward.

STEP 014a

Troubleshoot STEP 014
Context
No files attached. Diagnostics can include readable text/log files; other files are listed by name.