I have modem connected to my first ISP. Modem(IP 192.168.1.1) is bridged to my mikrotik(default IP 192.168.88.1) and i am getting internet by PPPOE configured in mikrotik. I have second ISP and i want to connect it to mikrotik router too. For the second ISP i am using gateway(IP 192.168.1.254) which is getting internet connetion by itself. What i want to do is connect gateway from second ISP to mikrotik by lan cable and pass all tcp traffic from my computer trough that second ISP , so ALL traffic except tcp traffic goes over my first ISP. Address on my lan adapter is 192.168.88.77. Can anyone help me with this?
#You need to mark-routing packets over tcp protocol and set the src-address with your IP from computer.
/ip firewall mangle
add chain=prerouting protocol=tcp action=mark-routing new-routing-mark=isp2-routing passthrough=yes src-address=192.168.88.77 disabled=no
#Add a default route manually, disable add-default-route from dhcp-client on ISP2.
/ip route
add dst-address=0.0.0.0/0 gateway=ISP2-out-interface or 192.168.1.254 distance=2 routing-mark=isp2-routing disabled=no
#To work with fasttrack rule, you must set !isp2-routing on routing-mark.
/ip firewall filter
add chain=forward action=fasttrack-connection routing-mark=!isp2-routing disabled=no
#Also, you need to create masquerade rules to work fine, changing only the out-interface.
Here, i use two pppoe-clients and i did this to my devices use only isp2, the rest of devices uses isp1.
Edit: You can use ISP2 to pass all traffic, then you don’t need to add the protocol=tcp to mangle rule.
I don’t recommend splitting your UDP and TCP traffic across two different ISPs. You can run into the issue where a connection uses both UDP and TCP and it will cause issues when the destination is seeing two different IPs.
I advise finding a better solution to using both ISPs.
If you have a specific application or service that you are connecting to. The Application on your device may need both TCP and UDP connections.
So let’s say that you first establish a TCP connection to service. The application then sends UDP packets, the receiving end would see a different IP and may not associate that traffic with your initial TCP connection thus the traffic will be dropped.
As I said earlier, you should find a better way to balance your traffic over the WAN links.