As above.
Brief summary of what I’m trying to achieve.
I’ve had a vpn (IP Vanish) that I’ve used for years. Until now, I just use the app on whatever device I need to use to change my location at that time but I recently got a Meta Quest 3S that doesn’t have the IP Vanish app without going through the hassle of setting up sideloading, so I decided to setup a wireguard connection on the Router itself to route everything through the VPN. It works, but I don’t want to use it unless I need it.
I set up using a guide I found on Youtube based on two routing tables and some rules that I can toggle on and off to enable or disable the vpn (ryzenvanish, metavanish which route individual devices, and allvanish which routes everything)
You’ll notice some entries to route things through the main routing table (essentially my internal network traffic, traffic from my Pihole and traffic from my own internal VPN that I use to dial into my services from outside. I had to allow my own OpenVPN server (10.10.10.63) to just get straight out to the internet, bypassing the VPN, in order for me to connect to it fully. I do have a secondary OpenVPN profile on each device that just routes my internal lan traffic and DNS queries through my network with everything else going straight to the big bad internet and that worked ok but I digress, I’m happy for my VPN server to just bypass the IP Vanish DNS for outbound connections of its own - even with the rule sending traffic from 10.10.10.63 straight to the normal WAN interface, I confirmed that clients connected to it routed through the IP Vanish VPN.
The only issue is, it’s a bit of a hassle toggling the routing rules on and off. I’ve setup scripts but I still have to ssh to run them.
Home Assistant has a custom Mikrotik integration that allows Mangle Rules to be toggled on and off so I thought I could do something with routing marks and configuring the tables that way, but I hit a brick wall when I was trying to assign a Mangle Rule to mark packets FROM my local LAN TO my Local LAN. As soon as I create the rule, (chain pre-routing, src-address-list LAN, dst-address-list LAN, action- mark routing-main) I lose connection to the router. Luckily I planned ahead and was in safe mode.
I’m assuming the problem is that the router itself is included within the lan address list ?
Can anyone shed any light on how I could progress? I just need to get past the point where I can have my local traffic marked with the routing mark “main” then I can figure the rest out myself.
config.rsc (68.9 KB)
Apologies for the config, you can tell I've done a lot of experimentation over the years and not all of it has been removed but it works for me.