2018 / 9 / 9
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
And uncheck Obtain an IP address automaticallyand set the IP address, netmask, gateway and DNS servers manually (check the IP's are available under the same subnet).
After adding the ip addresses go to advanced and add more ips within 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 220.127.116.11, 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 18.104.22.168, 22.214.171.124, and so on up to 126.96.36.199.
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.
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.
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.