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 automatically and 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 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 188.8.131.52, 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 184.108.40.206, 220.127.116.11, and so on up to 18.104.22.168.
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.