Gateway/Location VLAN routing
Reference topology & assumptions
Location A 10.0.0.0/24 ─┐
Location B 10.0.1.0/24 ─┤ ┌────────────┐ eth0.10 ──► VLAN 10 ──► 192.168.10.0/24
Location C 10.0.2.0/24 ─┴─► │ WG host / │ eth0.20 ──► VLAN 20 ──► 192.168.20.0/24
(wgX tunnel) │ router │ eth0.30 ──► VLAN 30 ──► 192.168.30.0/24
└────────────┘ (eth0 = 802.1Q trunk to switch)Step 1: Enable forwarding and loosen rp_filter
rp_filter# /etc/sysctl.d/99-vpn.conf
net.ipv4.ip_forward = 1
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2Step 2: WireGuard Internal VPN Networks

Step 3: Create the VLAN interfaces
Step 4: Policy-based routing by source subnet
Option A: Location reaches its own segment only
Option B: Location's full default route via its VLAN
Step 5: Return path (the critical part with no NAT)
Case A: Defguard Gateway host is the segment gateway
Case B: a separate router/firewall is the main gateway
Where the access policy lives
Step 6: Make it persistent
Step 7: Verify
Last updated
Was this helpful?