Forum Discussion
Creating an iRule with different multiple ports for one VIP
I have a VIP that needs to respond to multiple ports. They are not in the same range so would my below iRule work?
when CLIENT_ACCEPTED { if {([TCP::local_port] = 799 ) && ([TCP::local_port] = 8914) || ([TCP::local_port] = 3000 ) && ([TCP::local_port] = 3050) } { pool Test_pool } else reject }
1 Reply
- Kevin_Stewart
Employee
You're saying: if (the local port is 799 AND 8914) OR (local port is 3000 AND 3050), then allow it.
Try this:
when CLIENT_ACCEPTED { switch [TCP::local_port] { "799" - "8914" - "3000" - "3050" { return } default { reject } } }You also shouldn't need the pool statement there if you have the pool assigned to the VIP.
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