Community discussions

MikroTik App
 
WojtusW5
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 94
Joined: Mon Oct 02, 2017 1:25 pm

Separate routing tables in RouterOS v7

Fri Dec 17, 2021 8:10 pm

Hello, I have a question regarding the configuration of routing traffic to different routing tables in RouterOS v7.

In RoSv6, wanting to redirect even very specific traffic (for example by specifying IP addresses, interfaces, port and protocol), I simply did routing mark, then adding routing in IP-> Route, I could choose the previously manually entered routing-mark.

In RoSv7 I see that first I have to add the routing table manually in Routing-> Tables and do the above operation by selecting the table name in IP-> Routes from the list as routing-mark.
I understand that up to this point the percentage will be the same as in the case of the configuration made in RoSv6?

However, by adding the Routing-> Rule option (all configuration below), can I make the traffic within my NS-e7 table not go to the main table, thus eliminating the need for a firewall that cuts this traffic?

My config:
/ip firewall mangle
add action=mark-routing chain=prerouting in-interface-list=L2TP_Interface_loc_NS-e7_staff new-routing-mark=NS-e7 passthrough=yes
/routing table
add disabled=no fib name=NS-e7
/routing rule
add action=lookup-only-in-table disabled=no routing-mark=NS-e7 table=NS-e7
/ip route
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=172.28.1.1 pref-src="" routing-table=NS-e7 scope=30 suppress-hw-offload=no target-scope=10
 
User avatar
mac86
Member Candidate
Member Candidate
Posts: 126
Joined: Sat Nov 25, 2006 12:52 am
Location: bahia blanca - argentina
Contact:

Re: Separate routing tables in RouterOS v7

Sat Jun 08, 2024 3:20 am

same problem here
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 23378
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Separate routing tables in RouterOS v7

Sat Jun 08, 2024 3:50 am

Be advised routing rules are useful for FORCING some source addresses or subnet OUT a specific WAN.
a. one has to ensure that they identify if local traffic is also required, as FORCING means all traffic. ( there are ways to deal with this )
b. mangling rules SUPERCEDE routing rules if there is overlap.
c. WHAT determines if the identified sources are LOCKED to the special table or not is the ACTION command.
action=lookup means the router will look for alternate routes on the main table if the table identified in the routing rule is not available.
action=lookup-only-in-table means that if the special table is not available, then no traffic will pass as the router will not look for an alternate route.