Forum Discussion

swo0sh_gt_13163's avatar
Icon for Altostratus rankAltostratus
Sep 05, 2013

Please validate iRule to Load balance the traffic based on SNAT.

Hello Folks,

I need your help by verifying my iRule, responsible to SNAT the traffic generated from one Site (B) and going to another site (A), and should select specif pool to communicate further.


if { [IP::addr [IP::remote_addr] equals mask] } {
        pool Test_Pool
    else {pool Normal}

Brief information about customer setup.

  1. Client has 2 sites located on different geographic area.
  2. We are managing their network setup.
  3. Being an ISP, we are responsible to load balance all the traffic flowing between two sites.
  4. Now, they have configured their network in such a way, where SiteA should see only one specific IP address when SiteB tries to communicate with SiteA.
  5. At the same time, load balance should work for both the sites.

Please feel free to reply if you need any further informaiton to verify the iRule or share a better one.

2 Replies

  • Assuming that is routable back to the site, looks fine. Just one tweak that will save 8% compute cycles on the IP comparison

      if  [IP::addr [IP::remote_addr] equals] } {
        pool Test_pool
      } else {
          pool Normal

    I wrote up an article a while back on IP Comparison performance if interested.