Load Balancing Based on Ips inside and outside the country

Hi,
one of my internet accounts has a better ping and download speed for websites which their servers are located inside the country but the speed for external servers is not so good.
so is it possible to balance the traffic in a way that those packets coming from servers and IPs inside my country goes through one of my accounts and the rest through the other?
I have a HAP Lite routerboard.
Thanks

You would need to maintain the ip address lists and mangle connections accordingly. Then make routing decisions. I would take the foreign wan as default and domestic wan as exceptional for ip ranges registered to your country.

Thanks for your response but since I’m not much of a mikrotik pro, What method of load balancing is suitable for this purpose and i would appreciate it if you could give me more detailed instructions.

It’s not about balancing but about conditional routing if I understood you well. Am I right?

Yes, I guess you are right … let’s make it simple (for me) … for example a website like… I would like all the traffic of this website to go through pppoe-out1. Thanks

you need to find IP address resolution for this url … in this case 4 IP’s 185.147.178.11-185.147.178.14 based on nslookup. once you have this set of IPs you need to create access list that contain all IPs you want and right after you’ll need to create mangle rules with access list and route based on mangle rule marking.
your request is kind of loadbalancing as PCC on mikrotik wiki .. you need to change rules with per-connection-classifier to mark your particular IPs by using access lists.


Thanks for your response but since I’m not much of a mikrotik pro, What method of load balancing is suitable for this purpose and i would appreciate it if you could give me more detailed instructions.

this part is up to you … like it was said it’s basically conditional routing but if you have time to play you probably can run any algorithm you create with loadbalancing

Your problem is that there is no easy way to classify an IP as “inside the country” (especially for a large country).
You will have to ask the ISP that provides this faster service what the IP ranges are that have the fast service.
Then you can setup an address list with that information and use it to direct the traffic.
But it is academic, as probably they are not going to give you such a list.