Forum Discussion

swo0sh_gt_13163's avatar
swo0sh_gt_13163
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.

when CLIENT_ACCEPTED {

if { [IP::addr [IP::remote_addr] equals 1.1.1.0 mask 255.255.255.0] } {
        snat 1.1.1.1 
        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.

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

    when CLIENT_ACCEPTED {
      if  [IP::addr [IP::remote_addr] equals 1.1.1.0/24] } {
        snat 1.1.1.1
        pool Test_pool
      } else {
          pool Normal
      }
    }
    

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