Cae_140395
Aug 24, 2015Nimbostratus
Apply conditional SNATPOOL
Hello all!
I am with a issue of SNAT.
My pool have pool-members from differents subnets. I need apply SNAT 10.100.2.253 when the choosen pool-members are from network 10.100.2.0/24 and the SNAT 172.26.160.71 to pool-members from network 10.100.6.64/27.
Are there a native configuration on BIG-IP 11.6. to solve this issue or do i need to apply an irule for this ?
I wrote two option of irules, but idon't know if is correct.
Data group with ip address from network 10.100.6.64/27:
ltm data-group internal DGROUP-THS {
records {
10.100.6.64/27 { }
}
type ip
SNATPOOL when poolmember 10.100.6.x are chosen:
ltm snatpool SNAT_THS {
members {
172.26.160.71
}
}
SNATPOOL when poolmember 10.100.2.x are chosen:
ltm snatpool SNAT_DEFAULT {
members {
10.100.2.253
}
}
1° Option irule:
when CLIENT_ACCEPTED {
if { [class match [IP::client_addr] equals DGROUP-THS]} {
snatpool SNAT_THS
} else {
forward
}
}
}
2° Option irule:
when LB_SELECTED {
if { [class match [LB::server addr] equals DGROUP-THS]} {
snatpool SNAT_THS
} else {
forward
}
}
And for two irule the snatpool SNAT_DEFAULT is set on virtual server.