I have 2 gateways of 2 differents ISP.
I want to redirect P2P traffic by one gateway and the rest by the other gateway.
I am implementing mangle and policy routing, but there is something incorrect.
I have 3 interfaces 2 for the gateways and 1 for Hotspot users.
Ether1 192.168.0.58/24 gw 192.168.0.1
Ether2 192.168.1.100/24 gw 192.168.1.254
Ether3 10.5.50.1 (Hotspot)
[admin@MikroTik] ip firewall mangle> print
Flags: X - disabled, I - invalid, D - dynamic
0 D ;;; This rule is added by hotspot for user test
src-address=10.5.50.145/32 action=passthrough mark-flow=hs-auth
1 p2p=all-p2p action=passthrough mark-flow=traficoP2P mark-connection=traficoP2P
2 p2p=all-p2p action=accept mark-flow=traficoP2P mark-connection=traficoP2P
[admin@MikroTik] ip policy-routing> print
Flags: D - dynamic
NAME
0 P2P
1 D main
[admin@MikroTik] ip policy-routing rule> print
Flags: X - disabled, I - invalid
SRC-ADDRESS DST-ADDRESS INTERFACE FLOW ACTION TABLE
0 0.0.0.0/0 0.0.0.0/0 all lookup main
1 0.0.0.0/0 0.0.0.0/0 all traficoP2P lookup P2P
table main
[admin@MikroTik] ip route> print
Flags: X - disabled, I - invalid, D - dynamic, J - rejected,
C - connect, S - static, r - rip, o - ospf, b - bgp
DST-ADDRESS G GATEWAY DISTANCE INTERFACE
0 S 0.0.0.0/0 r 192.168.0.1 1 ether1
1 DC 192.168.1.0/24 r 0.0.0.0 0 ether2
2 DC 192.168.0.0/24 r 0.0.0.0 0 ether1
3 DC 10.5.50.0/24 r 0.0.0.0 0 ether3
table P2P
[admin@MikroTik] ip policy-routing table P2P> print
Flags: X - disabled, I - invalid, D - dynamic, R - rejected
TYPE DST-ADDRESS G GATEWAY DISTANCE INTERFACE
0 static 0.0.0.0/0 r 192.168.1.254 1 ether2
I try to connect the emule but continues going by the first gateway.