Set Up a Separate Wi-Fi Network for WireGuard on OpenWrt

18.04.2025

Objective

With the WireGuard client package, an OpenWrt router can route traffic through a secure VPN tunnel. However, it’s not always desirable to route traffic from all devices through the VPN. A more flexible approach is to create a dedicated Wi-Fi network (SSID) that routes traffic via WireGuard, while keeping the existing SSIDs connected directly to the ISP.

Prerequisites

Set Up the WireGuard Interface

Set Up the LAN Bridge

💡 Alternatively, we can use VLANs instead of separate physical ports.

Create the VPN Wi-Fi Network

Configure the lanVPN Interface

Firewall Zone Configuration

⚠️ At this point, the setup is almost complete, we have set up an SSID, a bridge device, a LAN, a WAN interface, and their firewall zones, respectively — but it won’t work yet. By default, traffic from all LAN interfaces (in this tutorial, both lan and lanVPN) are still routed to wan. We still need to configure custom routing rules so that only lanVPN traffic is sent through the VPN.

Set Up Policy-Based Routing

Final step: Restart our router to apply all settings.