Force Traffic via specific interface

On one of my ROS 6.49.1 units i have a simple solution to force all traffic from a fixed IP out via a specific interface:
Mangle rule
0 ;;; Send laptop via 4G
chain=prerouting action=mark-routing new-routing-mark=BT4G passthrough=yes src-address=192.168.0.241 dst-address-list=!<lan_list> log=no log-prefix=“”
Routing rule
/ip route
add check-gateway=ping distance=1 gateway=192.168.0.254 routing-mark=BT4G
I have two questions:

  1. How would I achieve the same in ROS 7 - it seems to work somewhat differently ?
  2. Would it be possible to use a rule similar to the above but instead of specifying a source IP, it would be a dst port ?

Thanks

  1. Routing tables in v7 are not created automatically, you need to create them yourself in /routing/table/.
  2. Yes, just change mangle rule’s conditions.

Three configuration steps!

/routing table add name=BT4G fib

/ip route
add dst=0.0.0.0/0 gateway=4G_gateway table=BT4G

/routing rule
add action=lookup-only-in-table src-address=192.168.0.241/32 table=BT4G

++++++++++++++++++++++++
Summary: In this situation, the single IP address/user for all their traffic will be forced out the 4G gateway. There is no need for mangles, postrouting etc…
If you want the user to be able to access the MAIN WAN, if the 4G connection fails, then use the ACTION= “lookup”

Thank you so much for sharing this, makes a bit more sense now.
Will test this today, do you know if there is a way to do this based on src / dst port ?

Thanks again

Not that I am aware of, the choices in route rule are limited but my experience is commensurately limited as well.

Routing works with addresses. If you want ports, stick with mangle rules.