Forum Discussion
Brian_Herr_1028
Nimbostratus
Feb 13, 2007Changing destination pool TCP port via iRules
Nickel tour: In order to change the destination port on a flow we have to define the pool, member, and port as the destination in the iRule. We need to be able to define the pool and port and le...
JRahm
Admin
Feb 13, 2007This takes a class that has special TCP payload data that is mapped to a specific destination port. TCP is collected and analyzed for that special data, if it exists, findclass will pull out the appropriate port number and set the variable new_port, which you can then use in the LB_SELECTED event to direct to the appropriate pool member. Is this what you're looking for?
class port_map {
"special_data1 port1"
"special_data2 port2"
"special_data3 port3"
...
"special_data1500 port 1500"
}
when CLIENT_ACCEPTED {
TCP::collect XX
}
when CLIENT_DATA {
if { [TCP::payload XX] contains "myData" } {
set new_port [findclass [TCP::payload XX] $::port_map " " ]
}
TCP::release
}
when LB_SELECTED {
pool [LB::server pool] member [LB::server addr] $new_port
}
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