For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Tabish_Mirza_12's avatar
Tabish_Mirza_12
Icon for Nimbostratus rankNimbostratus
Aug 22, 2016

Loab Balancing base on source IP Addresses.

Hi Folks,

 

We are looking a irule to achieve below.

 

We have pool named BRM-App with two pool members (10.10.10.1 & 10.10.10.2).

 

We want AIA app 192.168.1.1,2 and .3 should always talk to pool member 10.10.10.1. and AIA app 192.168.1.4,5 and 6 should talk to pool member 10.10.10.2.

 

In case a BRM-App node is not available all traffic should go to the active node.

 

When the node becomes available again we need to go back to normal operation.

 

Thanks

 

1 Reply

  • You didn't mention if other source addresses should load balance to both, so I'll assume yes. There are a few different ways to approach this, so here is is just one.

    Create three pools:

    1. BRM-App that contains both pool members

    2. A separate pool that contains both pool members but applies priority group activation to prefer one pool member over the other (let's call this BRM-App-1).

    3. And another pool that contains both pool members but applies priority group activation to prefer the other pool member (let's call this BRM-App-2).

    Now you could use CPM (LTM policies), but for the sake of understanding the logic, here's an iRule that switches between the pools based on source address:

    when CLIENT_ACCEPTED {
        switch [IP::client_addr] {
            "192.168.1.1" -
            "192.168.1.2" -
            "192.168.1.3" { pool BRM-App-1 }
            "192.168.1.4" -
            "192.168.1.5" -
            "192.168.1.6" { pool BRM-App-2 }
            default { pool BRM-App }
        }
    }
    

    Here you're allowing native load balancing to happen in each case, but for specific source addresses, preferring one member over another based on source address. If the preferred in that pool fails, then the secondary will take over.