Forum Discussion

Sukumar_121924's avatar
Sukumar_121924
Icon for Nimbostratus rankNimbostratus
Feb 06, 2015

I wanted to send 193.16.0.0 /19 Subent traffic to one member of the pool and rest to another pool member .

I wanted to send 193.16.0.0 /19 Subent traffic to one member of the pool and rest to another pool member . I am new to iRules , please help me to create iRule for this.

 

3 Replies

  • There are a few good resources for learning how to do iRules, including the iRules 101 articles and this wiki page that talks about checking ip addresses.

    For what you would like to do, I'd suggest reading through the articles there to understand better how to write iRules, and then look into something like this (although if you're trying to manually set the backend node, I'd recommend making 2 pools, and setting the pool instead for those coming from that subnet instead of setting the node.

    when CLIENT_ACCEPTED {
        if { [IP::addr [IP::client_addr] equals 193.16.0.0/19] } {
            node 1.1.1.1 80
            pool POOL_A
        } else {
            node 1.1.1.2 80
            pool POOL_B
        }
    }
    
    • Michael_Jenkins's avatar
      Michael_Jenkins
      Icon for Cirrostratus rankCirrostratus
      Glad to hear. Don't forget to mark the answer as the solution if you would, please.