Forum Discussion
sb_2323_80570
Nimbostratus
Jan 26, 2010iRule for port and pool redirection
Hi,
Apologies for asking a dumb questions, But I want to create an iRule that redirects based on the destination IP and port
eg when a connection comes in on 443 it hits pool 2000 + the destination IP
> 192.168.0.2:443 = pool2002 on tcp_2002
ad when a connection comes on 8443
> 192.168.0.2:8443 = pool2002 on tcp_3002
The first part of the iRule seems to work but its second part that is failing
when CLIENT_ACCEPTED {
if {[TCP::local_port] == 443}
{
set pool_id [expr {[lindex [split [IP::local_addr] "."] 3] + 2000}]
log local0. "Selecting pool by TCP listener: $pool_id"
pool "pool$pool_id"}
elseif
{[TCP::local_port] == 8443}
{
set pool_id [expr {[lindex [split [IP::local_addr] "."] 3] + 2000}]
set pool_id [expr {[lindex [split [IP::local_addr] "."] 3] + 3000}]
log local0. "Selecting pool by TCP listener: $pool_id"
pool "pool$pool_id:$port}
}
Any help would be greatly appreciated
12 Replies
- sb_2323_80570
Nimbostratus
Thanks for the info, Tried the iRule suggested but still the packets dont get forwarded to end server on the port I want it to be forwarded to
Think I will have you use pool command to node , Is there anyway I can split traffic over two nodes ? if I use the node command it will only forward to one node of my pool.
Many thanks in advance - hoolio
Cirrostratus
Can you try replacing this line:
eval [lreplace $pool_selection 4 4 $port]
with:
node [lindex $pool_selection 3 3] $port
Aaron
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
