I have multiple default routes in the same "main" routing table.
Currently routes:
(suppose 10.10.10.0/24, 10.10.20.0/24, 10.10.30.0/24 are public IPs)
Code: Select all
# DST-ADDRESS GATEWAY DISTANCE
0 As+ 0.0.0.0/0 10.10.10.1 20
1 As+ 0.0.0.0/0 10.10.20.1 20
2 As+ 0.0.0.0/0 10.10.30.1 20
For example: all IPs from 10.10.10.0/24 using only gateway 10.10.10.1, and all IPs from 10.10.20.0/24 using only gateway 10.10.20.1
Since Zerotier doesn't let me chose routing table, so I want to use only main table.
Those three routes are automatically enabled with ECMP. Sometimes the connection from 10.10.10.0/24 will route to 10.10.20.1 since the ECMP is like load balancing.
I've tried to use mangle rules.
Code: Select all
add action=route chain=prerouting disabled=yes passthrough=yes route-dst=[b]10.10.10.1[/b] src-address=[b]10.10.10.0/24[/b]
add action=route chain=prerouting disabled=yes passthrough=yes route-dst=[b]10.10.20.1[/b] src-address=[b]10.10.20.0/24[/b]
I think I might be using the wrong method or missed something.
Hope I can get some advice regarding this setup, and thank you so much.