Search code examples
ftpjmeterjmeter-pluginsspoofing

JMeter - IP Source (aka IP Spoofing) option for FTP sampler


I'm trying to achieve FTP session to the server using different client IP address via JMeter. However IP source (aka IP Spoofing) option is only available with HTTP sampler.

BTW, I don't want to use the distributed test (master/salve). i want to simulate the same behavior whats being used by HTTP sampler.

Any help is highly appreciated.


Solution

  • Out of the box JMeter doesn't provide possibility set IP address to bind to so you have to do some scripting - change all FTP Samplers to JSR223 Samplers

    1. Download groovy-all.jar form Maven Central and drop it to the /lib folder of your JMeter installation
    2. Restart JMeter (if it's running) to pick the jar up
    3. Replace FTP Samplers with JSR223 Samplers (make sure that "groovy" is selected in the "Language" dropdown
    4. Instantiate FTPClient as follows:

      FTPClient client = new FTPClient();
      client.setPassiveLocalIPAddress("YOUR IP ADDRESS HERE");
      //FTP specific code here
      

    References: