Community discussions

MikroTik App
 
User avatar
roosho
just joined
Topic Author
Posts: 5
Joined: Thu Jul 20, 2017 7:45 am
Location: Dhaka, Bangladesh

Choose Two Different WAN for Facebook and Youtube

Mon Jan 01, 2018 9:26 pm

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.
Image
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?

Thanks in advance.
Regards
 
whitbread
Member Candidate
Member Candidate
Posts: 119
Joined: Fri Nov 08, 2013 9:55 pm

Re: Choose Two Different WAN for Facebook and Youtube

Tue Jan 02, 2018 12:27 am

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.
 
thekrzos
newbie
Posts: 29
Joined: Tue Aug 02, 2016 10:39 am

Re: Choose Two Different WAN for Facebook and Youtube

Tue Jan 02, 2018 2:17 am

Use mangle and routing table

Wysłane z mojego Redmi Note 3 przy użyciu Tapatalka

 
User avatar
roosho
just joined
Topic Author
Posts: 5
Joined: Thu Jul 20, 2017 7:45 am
Location: Dhaka, Bangladesh

Re: Choose Two Different WAN for Facebook and Youtube

Tue Jan 02, 2018 4:53 pm

Use mangle and routing table

Wysłane z mojego Redmi Note 3 przy użyciu Tapatalka
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
 
User avatar
sindy
Forum Guru
Forum Guru
Posts: 11118
Joined: Mon Dec 04, 2017 9:19 pm

Re: Choose Two Different WAN for Facebook and Youtube

Wed Jan 03, 2018 6:50 pm

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.

Who is online

Users browsing this forum: benonet, djonathanska, gargiuseppe and 41 guests