Forum Discussion
Ofir_73471
Nimbostratus
Sep 21, 2008Port Forwarding - Need Help
Hi,
I am new to the iRules , i need to write an iRule that will apply to a VS and will accept only TCP connection from a specific range of destination TCP ports .
Can someone suggest such an iRule ?
Thanks
- Nicolas_Menant
Employee
You should have checked the wiki it would have give you what you needwhen CLIENT_ACCEPTED { if { not([IP::addr [IP::client_addr]/16 equals "10.10.0.0"]) } { reject } }
- hoolio
Cirrostratus
If you're trying to allow access to specific ports on an any port VIP, you could check the TCP::local_port value (Click here) to make a decision:This event is triggered when a TCP connection is established between the client and the VIP when CLIENT_ACCEPTED { Check if the port is between 1001 and 1999 if {not ([TCP::local_port] > 1000 and [TCP::local_port] < 2000)}{ Log a debug message that we're resetting the TCP connection. log local0. "[IP::client_addr]:[TCP::client_port]: Request to illegal port: [IP::local_addr]:[TCP::local_port]" Send TCP reset reject } }
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