Forum Discussion
samir_110997
Nimbostratus
Apr 16, 2007Redirect trafic http to specific pool member and ftp trafic to another pool member
Please I'm a New user, I want to know if any one can help me to create rules so as to redirect trafic http to specific pool member and ftp trafic to another pool member.
thanks for all
best regards
5 Replies
- The easiest way is to create two virtual servers, both with the same address, one listening on port 80 (for HTTP) and another on port 21 (for ftp). Then just assign the two virtuals their own default pool of servers. No iRules involved at all.
If you need to use a wildcard virtual (listening on all ports), then you are going to have to do a TCP::collect to get the payload content and inspect it to determine which protocol it's using. Search the forums for TCP::collect and I'm sure you'll find several examples of using it. Once you have determined which protocol you are receiving, you can use the "node" command to send that connection to the specfied backend server.
Here's some pseudo code for the node command.... if { traffic is determined to be HTTP } { node 10.10.10.10 80 } elseif { traffic is determined to be FTP } { node 10.10.10.20 21 } ...
-Joe - samir_110997
Nimbostratus
thanks for your assisatance, but I want to manage the outbound trafic and not the inbound. in my networks there is many users whose access to the internet, and I wan to direct the users who uses HTTP ( access to yahoo.fr, lycos....) to the ISP1, and the users who use the protocole FTP to the ISP2, and all other outbound trafic will be loadbalanced between the two ISP.
thanks - hoolio
Cirrostratus
Regardless of the direction of the traffic, the concept for using a virtual server per protocol can work. You can still use a wildcard virtual server that will be used if a more specific port-specific virtual server is not configured for the requested port.
Aaron - samir_110997
Nimbostratus
thanks a lot, but please tell me what is the diffrence between the forwarding virtual server and the standard virtual server? for the outbound connection i have created the forwarding willcard virtual server is is right? - Michael_Voight1Historic F5 Account
Posted By Joe on 04/16/2007 2:54 PM
The easiest way is to create two virtual servers, both with the same address, one listening on port 80 (for HTTP) and another on port 21 (for ftp). Then just assign the two virtuals their own default pool of servers. No iRules involved at all.
If you need to use a wildcard virtual (listening on all ports), then you are going to have to do a TCP::collect to get the payload content and inspect it to determine which protocol it's using. Search the forums for TCP::collect and I'm sure you'll find several examples of using it. Once you have determined which protocol you are receiving, you can use the "node" command to send that connection to the specfied backend server.
Here's some pseudo code for the node command.... if { traffic is determined to be HTTP } { node 10.10.10.10 80 } elseif { traffic is determined to be FTP } { node 10.10.10.20 21 } ...
-Joe
Couldn't you do this on the client_accepted by just checking the port number?
when CLIENT_ACCEPTED {
if {([TCP::local_port] equals 21)
node 10.10.10.10 21
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