Forum Discussion
iRule for IP Forward Virtual Server (same IP as real server) to listen on multiple ports and forward on to Real Server IP
Hi,
I have written an iRule for a Virtual Server (IP Forward - 10.1.1.1) to listen on multiple ports (range) and forward to real server with same IP address:
when CLIENT_ACCEPTED {
if {([TCP::local_port] >= 23001)
&& ([TCP::local_port] <= 23005) } {
node 10.1.1.1
} else reject}
Can someone tell me if my syntax is correct?
Thanks,
Bruce
- Lee_Sutcliffe
Nacreous
You have a missing close parenthesis after 'else'. You will also need to make sure you VIP listens on all ports too. Other than that your iRule looks ok
when CLIENT_ACCEPTED { if {([TCP::local_port] >= 23001) && ([TCP::local_port] <= 23005)} { node 10.1.1.1 } else { reject } }
- Bruce_Morris
Nimbostratus
Hi Lee, thanks for the reply. I have the Virtual Server configured as suggested, but it is still rejecting valid connections, any thoughts?
Thanks,
Bruce
- Lee_Sutcliffe
Nacreous
Try adding some logging, you'll find the log entries in /var/log/ltm:
when CLIENT_ACCEPTED { log local0. "recevied request from [TCP::local_port]" if {([TCP::local_port] >= 23001) && ([TCP::local_port] <= 23005)} { log local0. "forwarding to node" node 10.1.1.1 } else { log local0. "rejecting request from [TCP::local_port]" reject } }
Recent Discussions
Related Content
* 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