IP Spoofing with LoadRunner
As described here ip spoofing is a technique for hiding real identity of the attacker on the net. It is mainly used for hacking but it can be helpful for performance tests as well.
Let’s say we have some fancy network infrastructure that cache some of our requests in the performance test. Because of that our results may be incorrect. To omit this issue we can change the IP address of each (e.g. HTTP) request that reaches the server and simulate load from multiple users not only on the application level but on the network level as well. In that case cache won’t affect performance tests. Fortunately folks from Mercury/HP implemented special function for IP spoofing in LoadRunner API.
-
lr_enable_ip_spoofing();
-
…
-
lr_disable_ip_spoofing();
To use it, first put your code between these to functions calls.
Second (before connecting to load generator!!!) enable IP Spoofer option in LR Controller (Scenario > Enable IP Spoofer).
Let the hacking begin
Tip:
There is an option in Controller (in Expert mode) to choose between multiple IP addresses per process or per thread (Tools > Options).

If you’re trying to simulate different network links, why not just use the Shunra feature that’s available on LR 9.5?
Maybe because I’m using LR 9.1
Shunra in LR 9.5 is not free for commercial use, right? I have to buy a license. Am I correct?
That is correct. Although it is built-in to LR 9.5 it is licensed and activated separately.
Hi,
I am using LR 9.5. Could some one let me know how to automate LRA creation using analysis API.
Some sample codes would be appreciated.
Thanks in advance!
Dheena.
OK, so the server receives the request from a spoofed address – but how will the response come back to the original load generator machine since its IP is different?
raster1: if it’s a synchronous call, I believe everything should be maintained by network layer so you shouldn’t worry about that. It should just work. In case of asynchronous call you would have such problem.