Forum Discussion
Port translation for outbound with port range
Based in the snat command documentation, it just accepts one port: https://devcentral.f5.com/wiki/irules.snat.ashx
You need to keep track of the port used, saving the information to the persistence table. For a new connection you assign the port, and save the port in the persistence table. When the connection is finished (CLIENT_CLOSED event), you need to delete the table entry. You also need to write the logic to check for next available port in the range, maybe having a global variable with an index that you increment (and return to the beginning when reach the higest number), and check that does not exit yet in the persistence table.
Have a look in this link about the persistence table: https://devcentral.f5.com/articles/irules-101-12-the-session-command
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
