IP Spoofing For Load Testing in JMeter

April 9, 2024
5 min read
Share this post

To emulate real time behaviour while doing on demand performance testing, we need to hit the target server with multiple virtual users using multiple IP addresses from a single Load Generator (LG) to keep the web server from blocking those virtual users. So we go for IP spoofing concept, to achieve this we need to configure few setting in network connection of LG.

Go to your control panel -> Network setting and choose a network to which your LG is connected and Properties and choose Internet Protocol Version 4-> Properties

FrugalTesting blog on Jmeter ip spoofing for load testing

And uncheck Obtain an IP address automatically and set the IP address, netmask, gateway and DNS servers manually (check the IP's are available under the same subnet).

FrugalTesting blog on Jmeter ip spoofing for load testing

After adding the IP addresses go to advanced and add more IPswithin the range of the subnet mask and say OK.

As the IP addresses for networks on the Internet are allocated by the InterNIC. If you have an Internet connection, then you would be allocated a network address by the agency that registered you, like the InterNIC. Let us assume this to be 192.6.132.0, a class C network. Then all the machines on this network would have the same network address. And the last 0 will be replaced by a number from 1 to 254 for the node address. So, nodes will have addresses 192.6.132.1, 192.6.132.2, and so on up to 192.6.132.254.

FrugalTesting blog on Jmeter ip spoofing for load testing
FrugalTesting blog on Jmeter ip spoofing for load testing

Now we need configure these IPs to JMeter that send the request using these IPs. Add the HTTP Request Sampler to the Thread Group, in advanced tab u can find IP/Hostname dropdown box and give the IP which we added through network settings.

FrugalTesting blog on Jmeter ip spoofing for load testing

To pass multiple ip addresses add a csv data set config and pass the csv file, where the ip addresses have been added and pass the variable name.

FrugalTesting blog on Jmeter ip spoofing for load testing
FrugalTesting blog on Jmeter ip spoofing for load testing

Now hit the target host by setting No of threads (users) and duration and check the server logs u can find the load was generating from multiple IPs. In this way we achieve IP spoofing through JMeter in load testing and performance testing.

Rupesh Garg
Rupesh Garg
CEO and Chief Architect
Our blog

Latest blog posts

Discover the latest in software testing: expert analysis, innovative strategies, and industry forecasts
Software Testing

Top 12 Software testing myths debunked

Rupesh Garg
Rupesh Garg
May 7, 2024
5 min read
Software Testing
Testing Tools

Exploring Software Testing with Selenium Framework

Rupesh Garg
Rupesh Garg
May 6, 2024
5 min read
Software Testing
Testing Tools

Exploring Software Testing with the Right CI/CD Toolset in 2024

Rupesh Garg
Rupesh Garg
May 6, 2024
5 min read