That looks right if you wanted to drop all requests coming into the virtual server with a Referer header of http://blahblah/. Can you test this on a test virtual server and add logging to see what was happening?
when HTTP_REQUEST {
if { ([HTTP::header "Referer"] eq "http://blahblah/") } {
log local0. "[IP::client_addr]:[TCP::client_port]: Dropping [HTTP::method] to [HTTP::host][HTTP::uri] with Referer [HTTP::header Referer]"
drop
} else {
log local0. "[IP::client_addr]:[TCP::client_port]: Allowing [HTTP::method] to [HTTP::host][HTTP::uri] with Referer [HTTP::header Referer]"
}
}
If your DNS is pointed to that IP Address, then you could change ownership of the IP Address.
Assign the IP Address to the BIG-IP and assign a different IP Address on the server. That way the traffic will flow through the Load Balancer and then to the server (after whatever manipulation you want to do with your iRules.
You cannot have the same IP Address on two devices, it creates an IP Address Conflict.
DNS → F5 Virtual Server → Pool (containing your server IP Address and Port).