Forum Discussion
Danny_Trinh_197
Nimbostratus
Feb 03, 2009script for port 443 and 50000-59999
Hello forum,
I have an iRule as below:
when CLIENT_ACCEPTED {
if { [TCP::client_port] < 50000 or [TCP::client_port] > 59999}{
drop
}
} ...
hoolio
Cirrostratus
Feb 03, 2009I think you want to check TCP::local_port not TCP::client_port. TCP::client_port is the source port.
You can check for the ports you want to allow using this:
([TCP::local_port] >= 50000 && [TCP::local_port] <= 59999) || [TCP::local_port] == 443)
And you can logically NOT that to drop everything else:
when CLIENT_ACCEPTED {
Check requested port
if { ! (([TCP::local_port] >= 50000 && [TCP::local_port] <= 59999) || [TCP::local_port] == 443)}{
Request was to an disallowed port, so drop it
drop
}
}
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
