Feature Request: Wireguard over VRF

The obvious answer here is, if you have no use case, it’s okay to not use it. E.g. I don’t need PPPoE, guess what, I’m still happy.

But in case you’re wondering, I’ll give an example. Let’s say you have a ProtonVPN subscription, and you specifically want one of your networks/vlans/ssids to use this vpn, and only that. For the example, I’ll assume, that this network is connected to ether3.

/ip address add interface=ether3 [...]
/ip pool add name=vpn-pool [...]
/ip dhcp-server add interface=ether3 address-pool=vpn-pool [...]
/ip dhcp-server network add dns-server=10.2.0.1 [..]
 `
/interface wireguard add name=proton [...]
/ip address add interface=proton address=10.2.0.2/32 network=10.2.0.1

/ip vrf add name=proton-vrf interfaces=proton,ether3

/ip route add dst-address=0.0.0.0/0 gateway=10.2.0.1 routing-table=proton-vrf

/ip firewall nat add chain=srcnat action=masquerade out-interface=proton

(This was not tested.)

And there you have it: no routing rules are needed, and no additional firewall rules are needed to isolate the main and proton-vrf networks.

Yes, of course you can do it both with routing rules and mark-routing, but as I said: the functionalities overlap significantly. Some would argue that this is cleaner. Who knows.

This was possible without the new feature already (and worked fine). The new feature is for the wireguard traffic itself. I gave an example where that is useful: creating a vrf for the internet connection, and then tunneling everything in the main vrf through wg, that is established in the vrf.

EDIT: dst-interface -> out-interface corrected.