I have the following network:

enter image description here

On LAN A, I have several hosts connected with two routers to LAN B. My goal is to use R1 and R2 to route traffic to LAN B/R3. For that, there are two solutions:

  • 50% of my hosts use R1, the other half R2 (like in the figure above), like by manually setting the gateway on each host.
  • Every hosts split their data between R1 and R2.

Cisco has a protocol called GLBP to achieve that, but in my case, R1 and R2 are Linux machines. So, how can I configure a load balancing system ?

  • Routing in linux is off-topic here
    – This
    Jun 20 '18 at 15:09
  • You could try to ask this question on Server Fault for a business network, or on Super User for a personal network.
    – Ron Maupin
    Jun 20 '18 at 16:00
  • @RonMaupin Ok, I will post it to Super User. Thank you.
    – Nakrule
    Jun 20 '18 at 17:05

Are you sure you wold like to load balance outbound? If hosts are just regular users with internet access, it is more likely that inbound balancing is needed. This is achieved by implementing routing protocols. For instance, if you run OSPF between R1-R2-R3, and both R1 and R2 will announce same subnet to R3, OSPF will do equal cost multipathing for you, i. e. load will be balanced. But if you would like outbound load distribution:

You can use different VLANs and VRRP implementation in Linux (keepalived). Distribute them in a way that half of your hosts resides in vlan A with VRRP master at R1, and the other half resides in vlan B with VRRP master at R2.

  • The main problem I have is that I my routers are virtual and I have to dynamically visualize more routers then the traffic grow. That mean setting up VLANS for my hosts is difficult, as I should create a new VLAN every time a new router boot.
    – Nakrule
    Jun 20 '18 at 15:00

Not the answer you're looking for? Browse other questions tagged or ask your own question.