Forum Discussion
Gill_32697
Nimbostratus
Oct 21, 2012help making redirect irule
Im new to irules, need some help writing a irule
vip: 10.1.255.32
node: 10.13.0.61
node: 10.0.1.213
Web programer wants any http request with
http://test.com/Akcelerant/… ...
nitass
Employee
Oct 22, 2012you can add more uri to httpclass.
anyway, this is an example in case of irule.
[root@ve10:Active] config b virtual bar list
virtual bar {
snat automap
destination 172.28.19.79:80
ip protocol 6
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve10:Active] config b class uri_class list
class uri_class {
{
"/akcelerant/"
"/idsakcelerant/"
"/idsakcelerantmtg/"
"/lmakcelerant/"
}
}
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
set uri [HTTP::uri]
if { [class match -- [string tolower $uri] starts_with uri_class] } {
node 200.200.200.111
} else {
node 200.200.200.101
}
}
when HTTP_RESPONSE {
log local0. "[IP::client_addr]:[TCP::client_port] -> [clientside {IP::local_addr}]:[clientside {TCP::local_port}] -> [IP::remote_addr]:[TCP::remote_port] | $uri"
}
}
[root@ve10:Active] config cat /var/log/ltm
Oct 22 09:17:21 local/tmm info tmm[7926]: Rule myrule : 172.28.19.251:36438 -> 172.28.19.79:80 -> 200.200.200.111:80 | /Akcelerant/something
Oct 22 09:17:30 local/tmm info tmm[7926]: Rule myrule : 172.28.19.251:36439 -> 172.28.19.79:80 -> 200.200.200.111:80 | /IDSAkcelerant/something
Oct 22 09:17:34 local/tmm info tmm[7926]: Rule myrule : 172.28.19.251:36440 -> 172.28.19.79:80 -> 200.200.200.111:80 | /LMAkcelerant/something
Oct 22 09:17:39 local/tmm info tmm[7926]: Rule myrule : 172.28.19.251:36441 -> 172.28.19.79:80 -> 200.200.200.111:80 | /IDSAkcelerantMTG/something
Oct 22 09:17:42 local/tmm info tmm[7926]: Rule myrule : 172.28.19.251:36442 -> 172.28.19.79:80 -> 200.200.200.101:80 | /somethingelse/
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