Community discussions

MikroTik App
 
mmotti
just joined
Topic Author
Posts: 15
Joined: Thu Nov 17, 2022 9:50 pm

Route all traffic through WireGuard VPN provider but keep LAN access between subnets?

Tue Nov 22, 2022 3:04 pm

Hi,

I am currently running my wireless devices through Nord Lynx and have so far:
  • Created a routing table
    Added IP routes for 0.0.0.0/0 to my WireGuard gateway for said routing table
    Added necessary firewall rules
    Added a routing rule to take 192.168.5.0/24 through only the WireGuard lookup table.

All works fine however I obviously lose access to my other subnets unless I manually create a route for each subnet in the WireGuard table.

I was considering specifying 192.168.0.0/16 as a routing rule instead to throw all of my traffic through the tunnel, but before I do so, I just wanted to check whether there was a better way to allow LAN traffic back without specifying each subnet / gateway in the WireGuard routing table? Mostly so I don't forget to maintain the table if I add further subnets.

I'm not sure if I'm missing anything obvious as I'm new to networking.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 14520
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Route all traffic through WireGuard VPN provider but keep LAN access between subnets?  [SOLVED]

Fri Nov 25, 2022 4:29 pm

Not quite!!
Simply place an additional routing rule PRIOR to the existing rule.... (order counts)

add dst-address=local subnet (.0/24) action=lookup-only-in-table table=main
add src-address=192.168.5.0/24 action=lookup table=use-wireguard.


viewtopic.php?t=182340
 
mmotti
just joined
Topic Author
Posts: 15
Joined: Thu Nov 17, 2022 9:50 pm

Re: Route all traffic through WireGuard VPN provider but keep LAN access between subnets?

Fri Nov 25, 2022 4:47 pm

Not quite!!
Simply place an additional routing rule PRIOR to the existing rule.... (order counts)

add dst-address=local subnet (.0/24) action=lookup-only-in-table table=main
add src-address=192.168.5.0/24 action=lookup table=use-wireguard.


viewtopic.php?t=182340
Ahhh! OK, so I don't have to define these rules separately in each routing table, I could just create a 192.168.0.0/16 routing rule to only look-up in the main table and that would cover it centrally?
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 14520
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Route all traffic through WireGuard VPN provider but keep LAN access between subnets?

Fri Nov 25, 2022 9:14 pm

I never use 16, only 24, I never make any claims of being bigger than /24 ;-)

Who is online

Users browsing this forum: Sob and 45 guests