Community discussions

MikroTik App
 
achapman1146
just joined
Topic Author
Posts: 2
Joined: Sun Sep 12, 2021 1:42 am

Please help me with routeros 7 changes to how routing marks work

Thu Dec 09, 2021 11:57 pm

I am trying to load balance 2 similar LTE wan connections. However, all of the guides and discussions are now obsolete in routeros 7 due to the change from using routing-marks to using route tables. Here are my exports with a few comments inside. Will some kind sir or mam help me with this, tell me what I am missing, so I can get this going. Thanks in advance.

/interface bridge
add admin-mac=##:##:##:##:##:## auto-mac=no igmp-snooping=yes name=bridge

/interface ethernet
set [ find default-name=ether1 ] name=wan1
set [ find default-name=ether10 ] name=wan2

/ip address
add address=192.168.2.1/24 interface=bridge network=192.168.2.0
add address=192.168.3.2/24 interface=wan1 network=192.168.3.0
add address=192.168.5.3/24 interface=wan2 network=192.168.5.0

/ip firewall nat
add action=masquerade chain=srcnat out-interface=wan1
add action=masquerade chain=srcnat out-interface=wan2

/ip firewall mangle
add action=accept chain=prerouting disabled=yes dst-address=192.168.3.0/24 in-interface=bridge
add action=accept chain=prerouting disabled=yes dst-address=192.168.5.0/24 in-interface=bridge
add action=mark-connection chain=prerouting connection-mark=no-mark disabled=yes in-interface=wan1 new-connection-mark=wan1_conn passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark disabled=yes in-interface=wan2 new-connection-mark=wan2_conn passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark disabled=yes dst-address-type=!local in-interface=bridge new-connection-mark=wan1_conn passthrough=yes per-connection-classifier=both-addresses:2/0
add action=mark-connection chain=prerouting connection-mark=no-mark disabled=yes dst-address-type=!local in-interface=bridge new-connection-mark=wan2_conn passthrough=yes per-connection-classifier=both-addresses:2/1
# Here is where it goes off the rails. In version 7 we can no longer set routing marks as a mangle rule.
# It has to be done as a route. What is the syntax for properly setting up the to_wan routing-table?
# I tried, but couldn't make it work, so I disabled the routing rules until I could get help.
/ip route
add check-gateway=ping disabled=yes distance=1 dst-address=0.0.0.0/0 gateway=wan1 pref-src="" routing-table=to_wan1 scope=30 suppress-hw-offload=no target-scope=10
add check-gateway=ping disabled=yes distance=1 dst-address=0.0.0.0/0 gateway=wan2 pref-src="" routing-table=to_wan2 scope=30 suppress-hw-offload=no target-scope=10
#Added the following rule back to get internet access back while I solve this issue
add check-gateway=ping disabled=no dst-address=0.0.0.0/0 gateway=192.168.3.1 routing-table=main suppress-hw-offload=no
 
achapman1146
just joined
Topic Author
Posts: 2
Joined: Sun Sep 12, 2021 1:42 am

Re: Please help me with routeros 7 changes to how routing marks work

Fri Dec 10, 2021 6:09 am

I may have got it. It seems to be working, but the ole girl feels a tad sluggish. Maybe someone here can double check my solution?

/ip firewall mangle
add action=accept chain=prerouting dst-address=192.168.3.0/24 in-interface=bridge
add action=accept chain=prerouting dst-address=192.168.5.0/24 in-interface=bridge
add action=mark-connection chain=prerouting connection-mark=no-mark in-interface=wan1 new-connection-mark=wan1_conn passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark in-interface=wan2 new-connection-mark=wan2_conn passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark dst-address-type=!local in-interface=bridge new-connection-mark=wan1_conn passthrough=yes per-connection-classifier=both-addresses:2/0
add action=mark-connection chain=prerouting connection-mark=no-mark dst-address-type=!local in-interface=bridge new-connection-mark=wan2_conn passthrough=yes per-connection-classifier=both-addresses:2/1

/ip route
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.3.1 pref-src="" routing-table=to_wan1 scope=30 suppress-hw-offload=no target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.5.1 pref-src="" routing-table=to_wan2 scope=30 suppress-hw-offload=no target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.3.1 pref-src="" routing-table=main scope=30 suppress-hw-offload=no target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.5.1 pref-src="" routing-table=main scope=30 suppress-hw-offload=no target-scope=10
 
Sob
Forum Guru
Forum Guru
Posts: 9121
Joined: Mon Apr 20, 2009 9:11 pm

Re: Please help me with routeros 7 changes to how routing marks work

Fri Dec 10, 2021 6:52 pm

AFAIK there's no major difference, only in "/ip route" original parameter routing-mark is now named routing-table, and routing tables are no longer created automatically, you have to create them manually in "/routing/table".

Who is online

Users browsing this forum: Google [Bot] and 94 guests