Route a section of LAN through VPN

I'm trying to create a config that routes part of my LAN through the VPN and the other through normal WAN, but I can't.
Devices are:

  • ISP cablemodem with WLAN and LAN. Subnet
  • Mikrotik router (OpenWRT 19.07.1) with WLAN and LAN. Subnet Static IP for its network and for the WAN (cablemodem)

I use the LAN on the Mikrotik for file sharing between devices and internal communication. Ideally I'd like to have part of the actual subnet routed through the VPN and the other through WAN but I'm open to split subnets to and, providing connection between them is possible for file sharing as I said.

VPN is NordVPN and config works nicely after following this tutorial made by a forum user.

Any help appreciated.

No need to split subnets.

Use a "subset" or contiguous block from your existing subnet and dhcp reservations for vpn hosts.

You can then use a combination of dhcp tags and policy routing to achieve the goal.

i.e. addresses are for vpn... then when you create the policy route use a vlsm of to match any host with an address in the second half of the subnet.

Find a subnet calculator... you will probably need a /27 or /28 so the calculator will tell you where to start and end your host range.

1 Like

Thank you! I'll try that.