Forum Discussion
iRule tp detect HTTP and TCP requests and then do some magic.
In addition to what Stanislas said, also note that with your existing iRule, you are using http commands and events which means that you have an http profile on your Virtual Server. What the profile does is it makes the BIG-IP parse http headers, which means that the traffic must conform to some base minimum of the http standard. That in turn means that traffic that isn't http going through that Virtual Server will fail, since the BIG-IP will drop non-http traffic. So it's unlikely that you will be able to handle both types of traffic on the same Virtual Server.
Supposedly there's a way around that by creating a http profile that uses transparent as the proxy type, but I haven't played around too much with that so I'm not sure how well that actually works.
- N__197982Oct 04, 2017
Nimbostratus
Here is what I managed to work on. I will be setting a static port for this custom TCP application to run. The HTTP iRule can run as it is to work on present requests.
The iRule I worked on is:
when CLIENT_ACCEPTED { log local0.debug "CLIENT_ACCEPTED" TCP::collect 50 } when CLIENT_DATA { if { [TCP::payload 50] contains "external.com" }
Now, I want to capture that name which is before the external.com and take that in a variable. Then do a lookup using that name and appending internal.com.
After that take that name.internal.com and set the resolved IP address as the pool member
any comments?
- Henrik_GyllkranOct 04, 2017
Nimbostratus
Yeah, I would use a stream expression to deal with rewriting the data, since you can't use HTTP commands. Have a look at the STREAM::expression syntax for some examples.
- N__197982Oct 04, 2017
Nimbostratus
in this case the stream before the .external.com will have to be queried. How can that be done?
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
