I have a router-board 433AH and I have 2 internet link that separated physically and with 2 various gateways. The first link has 2 mbps bandwidth and the second one has 1 mbps.
Is there anyway to do this ===> The primary internet usage is link(1) and at the peak time, when the link(1) is fully loaded, the link(2) will be there and add to the total bandwidth usage and total internet bandwidth will be 3 mbps. After that, when the internet usage is decreased, the link(2) will be in its previous situation and out of service and the total bandwidth will be 2 mbps.
You marked only HTTPS and FTP.
Is it needed to mark other requests like web pages on TCP 80 or etc?
I think we should mark all of the traffic and by this way that you suggested, we are balancing the traffic that we manually marked.
Am I right?
The reason HTTPS and FTP are marked before everything is because most banking websites (or secure websites for that matter) require a user to keep a connection using the same ip address.
If this rule is not there, the HTTPS traffic will bounce between both gateways (which have 2 different external ips) and the bank website would refuse access to the user based on that.
I’m unsure if it applies to ftp but I went ahead and put that in there for our server.
Everything else (port 80) web surfing should be fine bouncing across each gateway.
If you find that a certain website requires that you have a dedicated IP for that connection, you can simply add in it’s ip address into dst-address and have it route to a specific gateway each time.
As you can see by our stats, it does a pretty good job balancing everything equally.
Thanks a lot for your complete help, but here I am a different scenario I believe.
I want to use the link(1) that it has 2mbps traffic limit and in normal situation, the link(2) is free and no request or traffic will route via this link(2).
The link(2) only routes the traffic to his own gateway that the link(1) is full. It means I am searching for an automatic mechanism that detects this case and automatically bring the link(2) to the internet usage and also automatically detects that the internet usage is less than 3mbps and automatically remove the link(2) routes.
Is there any way to do this case ?!
I think we should work on some scripts that detect this case.
What you’re asking for isn’t a load balancing solution but rather a routing solution. It’s common in multi-router/multi-gateway scenarios. We have a couple of primary links and a backup satellite link which is only used if the primaries are saturated. OSPF adjusts metrics based on bandwidth so it should work for you though I’ve never done it in a single unit before. You’d need a script or service to look at link usage vs. bandwidth and adjust the costs of the routes based on the load.
What I would do is have two static routes, one for your primary link with a routing cost of 2, and one with your primary and secondary link with a routing cost of 1 that’s disabled.. Then you have a script look at the usage of link 1 and if it goes over a certain amount. (75% of the actual speed you can pull over an average of say 5 minutes) have it enable the route with the two gateways then when the usage gets to say 25% you can disable that route to switch traffic to your primary link.
You would still need mangle and marking rules to handle https, ftp, and IM along with anything else that has a low tolerance for source ip switches.
Simple answer, there’s no way to make it seamless to your users. Whole reason for using PCC is to keep connections on the same WAN link, once established, so they have the same src IP. At anytime script decides to stop routing to the second WAN link, connections will have to be removed from connection tracking (unless you’re willing to keep established connections until closed/expired)
In your case I’d configure PCC for two WAN links then have a script assign 2nd connection traffic route mark 1 or 2: