nerdexam
F5

201 · Question #48

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 80 } { pool pool1 } elseif {[TCP::local_port]…

The correct answer is D. Unknown. The pool cannot be determined from the information provided. The iRule uses conditional logic to assign pools only for connections on port 80 or 443. For a connection to port 22, neither condition is satisfied, and without an else block or default pool configuration, the pool that will receive the request cannot be determined from the…

Section 7: Configure Advanced Features

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 80 } { pool pool1 } elseif {[TCP::local_port] equals 443 } { pool pool2 } If a user connects to 10.10.1.100 and port 22, which pool will receive the request.

Options

  • Apool1
  • Bpool2
  • CNone. The request will be dropped.
  • DUnknown. The pool cannot be determined from the information provided.

How the community answered

(32 responses)
  • A
    6% (2)
  • B
    9% (3)
  • C
    3% (1)
  • D
    81% (26)

Why each option

The iRule uses conditional logic to assign pools only for connections on port 80 or 443. For a connection to port 22, neither condition is satisfied, and without an `else` block or default pool configuration, the pool that will receive the request cannot be determined from the information provided.

Apool1

The connection is made to port 22, not port 80, so `pool1` will not be selected by the iRule.

Bpool2

The connection is made to port 22, not port 443, so `pool2` will not be selected by the iRule.

CNone. The request will be dropped.

The request will not necessarily be dropped; if a default pool is configured on the virtual server (information not provided), that pool would be used. If no default pool is configured and the iRule doesn't select one, the connection might eventually be reset or timed out, but 'dropped' is not a guaranteed outcome solely from the iRule.

DUnknown. The pool cannot be determined from the information provided.Correct

The iRule uses `TCP::local_port` to check if the incoming connection is on port 80 or 443. For a connection to port 22, neither the `if` condition (port 80) nor the `elseif` condition (port 443) is true. Since there is no `else` block in the iRule to specify a pool for other ports, and no default pool is mentioned as configured on the virtual server itself, the pool selection for port 22 is undetermined by the provided information.

Concept tested: F5 iRule conditional pool selection based on TCP port and default behavior

Source: https://techdocs.f5.com/en-us/big-ip-15-1-0/big-ip-irules-reference/tcp-local-port.html

Topics

#iRules#CLIENT_ACCEPTED event#TCP port#pool selection

Community Discussion

No community discussion yet for this question.

Full 201 Practice