LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   *BSD (https://www.linuxquestions.org/questions/%2Absd-17/)
-   -   OpenBSD pf round-robin weight (https://www.linuxquestions.org/questions/%2Absd-17/openbsd-pf-round-robin-weight-4175610631/)

kzl 07-26-2017 03:43 AM

OpenBSD pf round-robin weight
 
Hi!

Using this guide I've successfully done configuring pf load balancing multiwan.
( https://www.openbsd.org/faq/pf/pools.html )
However, my two connections should be weighted 1:15.
In the pf.conf manual ( http://man.openbsd.org/pf.conf ) I've read (for me) some obscure
reference to it at the round-robin section, but no example.

Can you provide me some instructions or reference how to do it?

Thanks in advance

jggimi 07-26-2017 05:39 AM

There is an example of round-robin weights in pf.conf(5):
Code:

    In this example, a NAT gateway is set up to translate internal addresses
    using a pool of public addresses (192.0.2.16/28).  A given source address
    is always translated to the same pool address by using the source-hash
    keyword.  The gateway also translates incoming web server connections to
    a group of web servers on the internal network.

        match out on $ext_if inet from any to any nat-to 192.0.2.16/28 \
            source-hash
        match in  on $ext_if proto tcp from any to any port 80 \
            rdr-to { 10.1.2.155 weight 2, 10.1.2.160 weight 1, \
                      10.1.2.161 weight 8 } round-robin

The GRAMMAR section shows weight defined as a component of a host.

kzl 07-27-2017 01:01 AM

Indeed, thank you! I should read more carefully...
Now the config looks like this and I'm getting the full speed of my connections:

Code:

pass in on $lan_if from $lan_net \
route-to { ($wan_if $wan_gw) weight 1, ($wan2_if $wan2_gw) weight 15 } \
round-robin



All times are GMT -5. The time now is 06:24 AM.