Forum Discussion

Tariq_Sako_9038's avatar
Tariq_Sako_9038
Icon for Nimbostratus rankNimbostratus
Nov 19, 2015

iRule - Specific Source to Specific Node

Hello All, can someone please help me with an iRule to send specific host who access VS IP to be sent always to specific node. appreciate your help

 

4 Replies

  • Here is a very basic way of doing it.

    when CLIENT_ACCEPTED {
        if { [IP::addr [IP::client_addr] equals 8.8.8.8] }{
            node 10.0.0.1
        }
    }
    

    Are you wanting to map multiple sources to multiple nodes? That would require a little more logic but can be accomplished with a data group with the value being the node you want a particular source to go to.

    when CLIENT_ACCEPTED {
        if { [class match [IP::client_addr] equals source_dg] }{
            node [class lookup [IP::client_addr] source_dg]
        }
        else {
            pool default_pool
        }
    }
    
  • thanks a lot for your kind help, the first one seems great, but will the rest of clients proceed normally load balanced to the nodes? or should i add (else) too there?

     

    • Brad_Parker's avatar
      Brad_Parker
      Icon for Cirrus rankCirrus
      With the first one if it doesn't match the IF statement then it will use the default pool assigned to the VIP. Typically if I'm going to use an iRule to load balance more than just a one off exception I use the iRule to pick the pool or node for all traffic. The first one I would just consider an exception so I wouldn't use the iRule to pick the pool or node for all traffic.