201 · Question #347
A virtual server is listening at 10.10.1.100:any and has the following iRule associated with it: when CLIENT_ACCEPTED { if {[TCP::local_port] equals 21 } { pool ftppool } elseif {[TCP::local_port]…
The correct answer is D. Unknown. The pool cannot be determined from the information provided. The iRule specifies pool assignments only for ports 21 and 23, leaving connections to port 22 without an explicit pool selection.
Question
A virtual server is listening at 10.10.1.100:any and has the following iRule associated with it:
when CLIENT_ACCEPTED { if {[TCP::local_port] equals 21 } { pool ftppool } elseif {[TCP::local_port] equals 23 } { pool telnetpool } If a user connects to 10.10.1.100 and port 22, which pool will receive the request?
Options
- Aftppool
- Btelnetpool
- CNone. The request will be dropped.
- DUnknown. The pool cannot be determined from the information provided.
How the community answered
(24 responses)- A8% (2)
- B4% (1)
- C13% (3)
- D75% (18)
Why each option
The iRule specifies pool assignments only for ports 21 and 23, leaving connections to port 22 without an explicit pool selection.
The `ftppool` is only selected if the `TCP::local_port` is 21, not 22.
The `telnetpool` is only selected if the `TCP::local_port` is 23, not 22.
While the iRule does not assign a pool for port 22, it does not explicitly contain a command to drop the request; the question asks which pool will receive the request, which cannot be determined from the iRule's explicit logic.
The iRule explicitly checks for `TCP::local_port` 21 or 23. If a connection is made to port 22, neither of these conditions is met, and there is no `else` statement to define a default pool, making the destination pool undetermined by the iRule itself.
Concept tested: iRule conditional logic and lack of default action
Source: https://clouddocs.f5.com/api/irules/TCP__local_port.html
Topics
Community Discussion
No community discussion yet for this question.