I tried the clone pool feature within the VIP settings but there’s no traffic being sent to the clone server (not layer 2 adjacent). The iRule below works but the traffic is sent to the clone pool on x.x.x.x.0 instead of x.x.x.x.8897. The VIP, the assigned pool and the clone pool are all wildcard. The port is correct when sent to the assigned pool but it’s 0 when sent to the clone pool. Customer needs the actual port on the clone pool. Any ideas?
PS. The customer uses 13 ports and counting. Would rather not create 13 VIPs, pools and iRules.
when CLIENT_ACCEPTED {
# Open a new HSL connection if one is not available
set hsl [HSL::open -proto TCP -pool mooglamacc-clone-0-pl]
#log local0. "[IP::client_addr]:[TCP::client_port]: New hsl: $hsl"
}
when HTTP_REQUEST {
# Insert an XFF header if one is not inserted already
# So the client IP can be tracked for the duplicated traffic
HTTP::header insert X-Forwarded-For [IP::client_addr]
# Check for POST requests
if {[HTTP::method] eq "POST"}{
# Check for Content-Length between 1b and 1Mb
if { [HTTP::header Content-Length] >= 1 && [HTTP::header Content-Length] < 1048576 }{
HTTP::collect [HTTP::header Content-Length]
} elseif {[HTTP::header Content-Length] == 0}{
# POST with 0 content-length, so just send the headers
HSL::send $hsl [HTTP::request]
#log local0. "[IP::client_addr]:[TCP::client_port]: Sending [HTTP::request]"
}
} else {
# Request with no payload, so send just the HTTP headers to the clone pool
HSL::send $hsl [HTTP::request]
#log local0. "[IP::client_addr]:[TCP::client_port]: Sending [HTTP::request]"
}
}
when HTTP_REQUEST_DATA {
# The parser does not allow HTTP::request in this event, but it works
set request_cmd "HTTP::request"
#log local0. "[IP::client_addr]:[TCP::client_port]: Collected [HTTP::payload length] bytes,\
sending [expr {[string length [eval $request_cmd]] + [HTTP::payload length]}] bytes total"
HSL::send $hsl "[eval $request_cmd][HTTP::payload]"
}
}