Forum Discussion
Bill_95597
Nimbostratus
Jan 29, 2013Capture client IP and redirect to virtual website - no SSL profile
I am moving all certificates off the LTM3900. This eliminates the use of ssl and http profiles. I have iRules that currently use http_request to get ip and replace http header.
Now I can use CL...
Kevin_Stewart
Employee
Jan 29, 2013Here's a TCP-only iRule to do redirection:
when RULE_INIT {
set static::REDIRSITE "http://www.f5.com"
set static::LOCALPOOL "local-pool"
}
when CLIENT_ACCEPTED {
if { [class match [IP::client_addr] equals my_ip_group] } {
log local0. "IP match: redirect"
TCP::respond "HTTP/1.0 302 Found\r\nServer: BIG-IP\r\nConnection: Close\r\nContent-Length: 0\r\nLocation: $static::REDIRSITE\r\n\r\n"
} else {
log local0. "No IP match: local pool"
pool $static::LOCALPOOL
}
}
That said, as Steve relays, if you're not terminating the SSL on the BIG-IP then you're not going to see any of the clear text traffic anyway. If your HTTP traffic is encrypted, then to use an HTTP profile (and HTTP iRule) you would indeed need an SSL profile applied to the virtual server. And if you wanted to see the clear text traffic for the above TCP iRule, you would still need an SSL profile. In fact if you want to do anything at all with iRules, you need to be able to see the requests and responses, which would require an SSL profile if the traffic is encrypted.
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