Below is a simplified diagram of my network.
There is a main router (R1) to access the internet.
Also there are 2 additional channels - Through router R3 and through VPN to VPS.
There is a need sometimes to output PC through additional channels.
I do this through mangle rules configured on routers R1 and R2:
Code: Select all
/routing/table/add name=route_to_VPS fib
/ip route add distance=1 gateway=192.168.1.20 routing-table=route_to_VPS
/ip firewall mangle add action=mark-routing chain=prerouting comment="Mark comp to VPS" dst-address-list=!my_int_ip in-interface-list=LAN new-routing-mark=route_to_VPS passthrough=no src-address-list=comp_to_VPS
/routing/table/add name=route_to_R3 fib
/ip route add distance=1 gateway=192.168.50.1 routing-table=route_to_R3
/ip firewall mangle add action=mark-routing chain=prerouting comment="Mark comp to R3" dst-address-list=!my_int_ip in-interface-list=LAN new-routing-mark=route_to_R3 passthrough=no src-address-list=comp_to_R3
But from subnet 192.168.15.0/24 only redirection to VPS works.
I successfully ping the gateway 192.168.50.1 from PC3 and PC4, but I can't use it as a gateway
I have tried to add routes:
Code: Select all
/ip route
add distance=1 gateway=192.168.50.1 routing-table=route_to_R3 scope=40 target-scope=30
add distance=1 dst-address=192.168.50.0/24 gateway=192.168.1.1 routing-table=main scope=30 target-scope=10
Can you tell me how to make it so that I can use gateway 192.168.50.1 on the R2 router?