Community discussions

MikroTik App
 
moshe12
just joined
Topic Author
Posts: 6
Joined: Sun Jan 28, 2018 2:51 pm

Route by MAC address on ROS V7.6

Tue Nov 08, 2022 9:35 pm

Hi,
I have now upgraded from V6 to V7.6
I have 2 ISP's and can't do simple routing like I would on V6.
Below is an example:
# model = RouterBOARD 750G r3

/interface pppoe-client
add add-default-route=yes default-route-distance=3 disabled=no interface=ether1 name=partner password=???????? use-peer-dns=yes user=??????????
add add-default-route=yes default-route-distance=5 disabled=no interface=ether1 name=older password=???????? user=?????????

/ip firewall mangle
add action=mark-routing chain=prerouting comment=ap new-routing-mark=older passthrough=no src-mac-address=XX:2D:21:XX:A4:XX

/ip route
add distance=2 gateway=older routing-mark=older
I am asking for your help on, how to route by MAC address to a older ISP ?
 
User avatar
smyers119
Member Candidate
Member Candidate
Posts: 232
Joined: Sat Feb 27, 2021 8:16 pm
Location: USA

Re: Route by MAC address on ROS V7.6

Thu Nov 10, 2022 12:40 am

you have two isp's coming in on the same interface??
 
moshe12
just joined
Topic Author
Posts: 6
Joined: Sun Jan 28, 2018 2:51 pm

Re: Route by MAC address on ROS V7.6

Thu Nov 10, 2022 1:08 am

Yes,
Why not?
 
moshe12
just joined
Topic Author
Posts: 6
Joined: Sun Jan 28, 2018 2:51 pm

Re: Route by MAC address on ROS V7.6

Thu Nov 10, 2022 1:29 am

incidentally,
I found part of the solution, but there is a new problem.
I tried to route from address 10.0.0.35 and I managed to route using mangle as you will see in the example below,
But it skips all internal routing
That is, there is no access from 10.0.0.35 even to the router's DNS server, nor is there access to the router itself.
/interface pppoe-client
add add-default-route=yes default-route-distance=3 disabled=no interface=ether1 name=partner password=???????? use-peer-dns=yes user=??????????
add add-default-route=yes default-route-distance=5 disabled=no interface=ether1 name=older password=???????? user=?????????

/routing table
add disabled=no fib name=older

/ip firewall mangle
add action=mark-routing chain=prerouting new-routing-mark=older passthrough=no src-address=10.0.0.35

/ip route
add disabled=no distance=2 dst-address=0.0.0.0/0 gateway=older pref-src="" routing-table=older scope=30 suppress-hw-offload=no target-scope=10
 
Sob
Forum Guru
Forum Guru
Posts: 9119
Joined: Mon Apr 20, 2009 9:11 pm

Re: Route by MAC address on ROS V7.6

Thu Nov 10, 2022 2:11 am

About route marking, see this: viewtopic.php?p=956630#p956630

In short, routing marks now have maximum priority, they will use only routes in given table, no exceptions => don't mark traffic destined to router.
 
moshe12
just joined
Topic Author
Posts: 6
Joined: Sun Jan 28, 2018 2:51 pm

Re: Route by MAC address on ROS V7.6

Sat Nov 12, 2022 7:46 pm

Hi Sob,
I tried to add a "/routing rule" and there is still no access to the router's interface from 10.0.0.35
Now I'm doing the tests on the lan address, but I need the mangel because I need to change the routing by mac address.
/interface pppoe-client
add add-default-route=yes default-route-distance=3 disabled=no interface=ether1 name=partner password=???????? use-peer-dns=yes user=??????????
add add-default-route=yes default-route-distance=5 disabled=no interface=ether1 name=older password=???????? user=?????????

/routing table
add disabled=no fib name=older

/routing rule
add action=lookup-only-in-table disabled=no dst-address=0.0.0.0/0 table=main

/ip firewall mangle
add action=mark-routing chain=prerouting new-routing-mark=older passthrough=no src-address=10.0.0.35

/ip route
add disabled=no distance=2 dst-address=0.0.0.0/0 gateway=older routing-table=older suppress-hw-offload=no
 
Sob
Forum Guru
Forum Guru
Posts: 9119
Joined: Mon Apr 20, 2009 9:11 pm

Re: Route by MAC address on ROS V7.6

Sat Nov 12, 2022 8:23 pm

No, I meant something like this:
/ip firewall mangle
add action=mark-routing chain=prerouting new-routing-mark=older passthrough=no src-address=10.0.0.35 dst-address-type=!local
In other words, don't mark what shouldn't be sent to internet. In this example it's any address on router.
 
moshe12
just joined
Topic Author
Posts: 6
Joined: Sun Jan 28, 2018 2:51 pm

Re: Route by MAC address on ROS V7.6

Sat Nov 12, 2022 9:53 pm

Finally it works
Thanks.

Who is online

Users browsing this forum: No registered users and 14 guests