Community discussions

MikroTik App
 
kcarhc
just joined
Topic Author
Posts: 13
Joined: Thu Feb 01, 2018 9:54 am

routing-mark and table and mangle in RouterOS v7 BETA 7

Thu Jun 04, 2020 2:58 pm

here is the code in RouterOS v6, how to make it work in RouterOS v7.

/ip firewall mangle
add action=mark-connection chain=prerouting connection-mark=no-mark new-connection-mark=CON-TEST passthrough=yes dst-address=4.2.2.1
add action=mark-routing chain=prerouting connection-mark=CON-TEST new-routing-mark=IRT-TEST passthrough=no

/ip route
add check-gateway=ping distance=10 gateway=10.10.54.161 routing-mark=IRT-TEST
add check-gateway=ping distance=10 dst-address=1.1.1.1/32 gateway=10.10.54.145

/ip route rule
add routing-mark=IRT-TEST table=IRT-TEST
add dst-address=8.8.8.8/32 table=IRT-TEST
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 6080
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: routing-mark and table and mangle in RouterOS v7 BETA 7

Thu Jun 04, 2020 3:47 pm

First add table in /routing table menu

THen you can add routing rules in /routing rule menu

and routes in specific table
/ip route add dst-address=x.x.x.x@table gateway=y.y.y.y@main
 
kcarhc
just joined
Topic Author
Posts: 13
Joined: Thu Feb 01, 2018 9:54 am

Re: routing-mark and table and mangle in RouterOS v7 BETA 7

Thu Jun 04, 2020 4:40 pm

@mrz, please help me translate my code to RouterOS 7.

====================code====================
/ip firewall mangle
add action=mark-connection chain=prerouting connection-mark=no-mark new-connection-mark=CON-TEST passthrough=yes dst-address=4.2.2.1
add action=mark-routing chain=prerouting connection-mark=CON-TEST new-routing-mark=IRT-TEST passthrough=no

/ip route
add check-gateway=ping distance=10 gateway=10.10.54.161 routing-mark=IRT-TEST
add check-gateway=ping distance=10 dst-address=1.1.1.1/32 gateway=10.10.54.145

/ip route rule
add routing-mark=IRT-TEST table=IRT-TEST
add dst-address=8.8.8.8/32 table=IRT-TEST
====================code====================
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 6080
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: routing-mark and table and mangle in RouterOS v7 BETA 7

Thu Jun 04, 2020 4:49 pm

/routing table add name=IRT-TEST fib

/ip route 
add dst-address=0.0.0.0/0@IRT-TEST gateway=10.10.54.161@main check-gateway=ping distance=10
add check-gateway=ping distance=10 dst-address=1.1.1.1/32 gateway=10.10.54.145

/routing rule 
add dst-address=8.8.8.8 action=lookup table=IRT-TEST
firewall the same as v6
 
kcarhc
just joined
Topic Author
Posts: 13
Joined: Thu Feb 01, 2018 9:54 am

Re: routing-mark and table and mangle in RouterOS v7 BETA 7

Thu Jun 04, 2020 5:25 pm

OK, Thanks, Works well on RouterOS 7
 
kcarhc
just joined
Topic Author
Posts: 13
Joined: Thu Feb 01, 2018 9:54 am

Re: routing-mark and table and mangle in RouterOS v7 BETA 7

Thu Aug 13, 2020 7:40 pm

############################

/routing table add name=IRT-TEST fib

/ip route
add check-gateway=ping distance=10 dst-address=0.0.0.0/0@IRT-TEST gateway=10.10.66.70@main

###########################
it works on 7.0 Beta 8
it don't work on v7.1 BETA 1 show this

invalid or unexpected vrf or routing table value
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 6080
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: routing-mark and table and mangle in RouterOS v7 BETA 7

Fri Aug 14, 2020 8:56 am

Who is online

Users browsing this forum: Alexa [Bot], emk2203 and 16 guests