Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Multi-WAN combining load balancing and policy based routing

    Scheduled Pinned Locked Moved Routing and Multi WAN
    4 Posts 3 Posters 3.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      GeorgeM
      last edited by

      I'm a bit new to the whole multi-WAN thing, so please forgive me if this has been discussed and I didn't know the right search terms to find it. (I did try….)

      I understand - at least conceptually - the idea of using rules to send certain kinds of traffic (e.g., ftp) to specific WANs, and to use a load-balance group for other traffic that isn't sensitive to which WAN is used. What I'm wondering is if the load-balancer only sees the traffic that goes through it, or if it considers ALL traffic through the relevant WANs? For instance if I'm doing a heavy FTP transfer on WAN1, will the load balancer "notice" that and tend to route other traffic to WAN2 - or will it continue trying to split load balanced traffic equally thus perhaps overloading WAN1, or at least slowing down the traffic assigned to it, while WAN2 remains under-used?

      1 Reply Last reply Reply Quote 0
      • K
        kathampy
        last edited by

        The first rule that matches in the firewall will take effect (which ever gateway group you've defined in the rule)

        1 Reply Last reply Reply Quote 0
        • G
          GeorgeM
          last edited by

          @KurianOfBorg:

          The first rule that matches in the firewall will take effect (which ever gateway group you've defined in the rule)

          I'm aware of that; as far as I can tell, it's not really relevant to my question. If I'm wrong, can you explain why?

          1 Reply Last reply Reply Quote 0
          • jimpJ
            jimp Rebel Alliance Developer Netgate
            last edited by

            It's completely relevant. The use of load balancing or failover for Multi-WAN is governed by firewall rules. Traffic doesn't pass "through" the load balancer in the way you imply. It also doesn't adjust itself based on traffic load.

            You just need multiple Gateway Groups, one for LB, and one that prefers each WAN.

            Then use firewall rules like so:

            pass from (lan subnet) to stuff_for_wan1 using the PreferWAN1 gateway group
            pass from (lan subnet) to stuff_for_wan2 using the PreferWAN2 gateway group
            pass from (lan subnet) to any using the LoadBalance gateway group

            The bandwidth of a client connection has nothing to do with how it's balanced between WANs. Balancing happens in a pure round-robin manner, adjusted by the weighting configured for a gatway, on a per-connection basis. It can't tell the difference between a download and a web page load, it would just send them out whatever WAN was due to be used at the time.

            If you have the default weights configured, and everything load balanced, you'd see something like this:

            Connection 1 -> WAN1
            Connection 2 -> WAN2
            Connection 3 -> WAN1
            Connection 4 -> WAN2
            Connection 5 -> WAN1
            Connection 6 -> WAN2

            Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

            Need help fast? Netgate Global Support!

            Do not Chat/PM for help!

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.