Community discussions

MikroTik App
 
sickrick
just joined
Topic Author
Posts: 2
Joined: Mon Oct 09, 2023 10:49 am

Wireguard policy based routing in routeros?

Mon Oct 09, 2023 5:57 pm

Hi, I own a hap ac2 with Openwrt on it. Now I bought a ac3 but since there's v7 sth. on it, I cannot flash Openwrt.
Instead of returning the ac3 I thought, I'll take a look at routeros. Maybe the same setup ist possible as I have in Openwrt.

So basically I have one wireguard server running to which I can connect from outside to reach my local network.
I also have a wireguard client running, that connects to Torguard.
Here's the catch: I only want a certain IP in my local network to run through that connection.

I was able to do so in Openwrt with this app: https://docs.openwrt.melmac.net/vpn-policy-routing/
and lots of help with firewall rules that caused me headaches, as a networking noob.

Is there sth. similar available in routeros?
 
User avatar
gabacho4
Member
Member
Posts: 399
Joined: Mon Dec 28, 2020 12:30 pm
Location: Earth

Re: Wireguard policy based routing in routeros?

Mon Oct 09, 2023 7:07 pm

Create a new routing table in Routing -> Tables. Then create a routing rule at Routing -> Rules and specify the IP you want and select the desired table and lookup only in table. Lastly make sure your firewall rules don't interfere. I assume you need to have a NAT rule as well for that gateway.
 
User avatar
infabo
Forum Guru
Forum Guru
Posts: 1474
Joined: Thu Nov 12, 2020 12:07 pm

Re: Wireguard policy based routing in routeros?

Mon Oct 09, 2023 10:09 pm

Policy Routing is pretty straight forward in ROS.

https://help.mikrotik.com/docs/display/ ... cy+Routing

It can even be more simple, using /ip/route maybe only.
 
sickrick
just joined
Topic Author
Posts: 2
Joined: Mon Oct 09, 2023 10:49 am

Re: Wireguard policy based routing in routeros?

Thu Nov 23, 2023 11:30 am

Sry to revive this Post. I went another route and run the wireguard client from one of my devices. Only wireguard server is running on my mikrotik router.
I was able to set everything up with one exception:
When I'm connected to my wg server I'd like to access the internet "directly" from my device, currently it's going through my router.

Can anyone help which firewall rule I'd need to add?
 
templlama
just joined
Posts: 12
Joined: Thu Nov 23, 2023 1:46 pm

Re: Wireguard policy based routing in routeros?

Thu Nov 23, 2023 2:22 pm

If you are a remote user and connecting to wireguard your options are:
a. connect to Router to config it.
b. connect to LAN devices/users
c. use internet of Router.

If you want to use local Internet of the remote device, dont turn on wireguard.
In other words has nothing to do with Mikrotik it has everything to do with the capabilities of the device you are using, aka does it allow split-tunneling

Who is online

Users browsing this forum: No registered users and 16 guests