Hello,
I’m using Mikrotik Routerboard RB2011UiAS-2HnD. I have two different PPPoE Internet connection and have successfully configured Load Balancing and Failover configuration. My network diagram is as following.
Now I need a solution. When ever I connect to Facebook it shall use ISP 1 connection via pppoe-out1 and for Youtube it shall use ISP 2 connection via pppoe-out2. How do I do that?
Any terminal command or GUI configuration instructions would be very helpful for me. Can anybody help me out here?
I would recommend using a proxy server configured by proxy.pac. This would give you the opportunity to route by source IP - everything coming from proxy goes WAN2, everything else WAN1.
As far I understand using Mangle and routing table is the best way. But I don’t know how to do it. Can you please help me out here by giving some tutorial link?
Thanks and Regards
I was dealing with a very similar issue 8 hours ago and found this one very clear: https://wiki.mikrotik.com/wiki/Policy_Base_Routing. Basically you use the mangle table to attach a routing mark to a packet as it enters the box, and then refer to that mark in the static routing table.
Just don’t take seriously the idea to assign a routing mark by packet contents, because it would send your DNS query (a UDP packet with “youtube” in it) to the right route but not the TCP SYN packet establishing the session for actually downloading the page, as the SYN packet contains no text at all. Additionaly, the trouble with Youtube is that it uses the same IP addresses like all Google services so there is a close to zero chance to access different Google services using different routes. In general any large service uses many subnets and they vary by region and change over time. So maybe some script keeping an eye on the DNS cache contents and modifying the mangle rules accordingly could be your way out.