PLEASE HELP. I am trying to apply an iRule to a virtual server. So I am using the below code for testing if the iRule is active. All the below code suppose to do is to redirect all traffic to google. However, nothing seems to happen. I am not even sure if the iRule is called. I can see the iRule via the network map under the virtual server (the circle next to it is white though, should it be?).
PLEASE HELP. I am trying to apply an iRule to a virtual server. So I am using the below code for testing if the iRule is active. All the below code suppose to do is to redirect all traffic to google. However, nothing seems to happen. I am not even sure if the iRule is called. I can see the iRule via the network map under the virtual server (the circle next to it is white though, should it be?). when HTTP_REQUEST { HTTP::redirect “http://www.google.com” }
Is your virtual server using https or http? If https, are you offloading the SSL at the F5? If not, I don’t think you’ll be able to do anything with the request.
and then look at the statistics tab in the config UI for that virtual server… if you open the web site (the VIP) and refresh the statistics, do those stats change as you would expect?
I may be wrong (not really a networking guy), but I don’t think you can access a vip at 0.0.0.0. You probably can’t ping it can you? Can you update the destination vip to something different (like other vips you may have) and try that?
This VS listens to my internal VLAN traffic, I guess I can use the network ID of this VLAN as source for the VS. However, I can’t specify a particular destination IP,I have more than ONE ISP router from different networks configured, that are LB by this VS.
If you are using FastL4 (as you have to, if you have the 0.0.0.0 wildcard IP forwarding virtual server), I think it does not allow L7 processing, and in your iRule the HTTP_REQUEST event is Layer7 processing.
Its a performance (Layer 4) virtual server. The other types do not show an option to select a HTTP profile (after selecting advance). Accordingly, I have to attach a http profile so I can have access to the HTTP_REQUEST event, otherwise One can’t add the iRule.
Sorry, should have read more carefully about the vs type. I think I came across a similar problem quite a while ago. The performance L4 vs is meant for L4 processing and FastL4 is using hw PVA acceleration if possible. I believe the PVA acceleration mode should be set to none to allow HTTP processing with iRules. Not sure if it helps. What if you used additional standard vs or performance (HTTP) virtual server for 0.0.0.0:80 with the iRule instead of the 0.0.0.0:0? You can leave the full wildcard one without the iRule to serve all other ports if needed.
Or change the vs type to standard instead of performance L4? You can also add logging line(s) to the iRule to see whether it fires and does the logic you want.
Try this and see if the irule is hit when CLIENT_ACCEPTED { log local0 " IP::addr [IP::client_addr] client accepted" } Check the ltm logs tail /var/log/ltm
in case you want to redirect a client with your virtual server it has to be of type “Standard” and needs an HTTP-profile assigned. The type “Performance-HTTP” is very limited in capabilities (supports just cookie insert and XFF insert, afaik).
If you change the configuration of your virtual server it will be necessary to close all connections from the client you are testing with because existing connections are not affected by the change.
In case of using i.e. Firefox it really means to close all firefox instances!
You can also temporarily add a log statement to your iRule to check the event is triggered:
when HTTP_REQUEST {
log local0. "New http request from client <[IP::client_addr]> received <[HTTP::method] [HTTP::uri] [HTTP::version]>, will be redirected"
HTTP::redirect "http:://www.google.com"
}
From bash please run the following to track the new log events for /var/log/ltm facility: