Forum Discussion
Looking for an iRule that will take the same IP from SNAT Pool as that of the source IP.
i am using at the moment
when CLIENT_ACCEPTED {
if { [IP::addr [IP::client_addr] equals 172.16.50.1/32] }{snat 172.16.50.1}
}
But i had to manually add for 50.1/32 till 52.254/32 .
The one you mentioned, only works for a subnet. The requirement is to map the third and last octet of the SNAT IP to be the same as the client IP.
at the moment all works, only problem is that i had to manually add all that entries.
Was looking for a logical irule where SNAT IP can be matched to client IP.
Here are some ingredients to help you bake it:
% set ip 1.2.3.4
1.2.3.4
% set ip_splitted [split $ip .]
1 2 3 4
% set host [lindex $ip_splitted 2].[lindex $ip_splitted 3]
3.4
% set net [lindex $ip_splitted 0].[lindex $ip_splitted 1]
1.2
%
Let me know if it is not clear
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com