Forum Discussion
hoolio
Cirrostratus
Jun 14, 2007TCP port logging/decision-making with a FastL4 profile
Hello,
Can someone provide more info on why MCP validation of iRules prevents using TCP:: commands with a forwarding IP virtual server/fastL4 profile?
The reason I ask, is that I'd like to g...
hoolio
Cirrostratus
Dec 14, 2007Hi,
You can use the example workaround from above to get the TCP source and/or destination port, without disabling the MCP validation. The destination port is the port the client made the request to.
when CLIENT_ACCEPTED {
log the client IP address:port -> destination IP address:port
set src_port_cmd TCP::client_port
set src_port [eval $src_port_cmd]
set dest_port_cmd TCP::local_port
set dest_port [eval $dest_port_cmd]
log local0. "client: [IP::client_addr]:$src_port -> [IP::local_addr]:$dest_port"
if {$dest_port > 1024}{
requested port was over 1024, so drop it
drop
} elseif {$dest_port > 100 and $dest_port <= 1024}{
port was over 100 and less than 1024 so forward the request
forward
} else {
requested port was less than 100, send a RST
reject
}
}Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects
