Goal: Allow LANforge to simulate a FTP connection within the same system.
This scenario is useful if you wish to generate stateful FTP traffic between two physical ports using a single LANforge system. You will need two non-management physical ports connected to eachother with a loopback cable or switch.
Configure the physical interfaces. We will set up eth1 as a client and eth2 as a FTP server.
Go to the Port Mgr tab and select eth1.
Click Modify to configure port eth1.
Set the IP Address to 10.0.0.101/24.
Click OK.
While still in the Port Mgr tab, select eth2.
Click Modify to configure port eth2.
Set the IP Address to 10.0.0.102/24.
Enable FTP under Services.
Click OK.
Create a file for the FTP client to download/upload. This is optional if you already have a file in mind to test with, just make sure the file is in /home/lanforge (the default directory for FTP). Step 3 explains how to upload a file from a Windows machine.
First, you'll need to open a console on the LANforge system.
Log into the machine directly or remotely through rdesktop. The user/password should be lanforge/lanforge for both.
To log in via rdesktop type the following command into a console (replace LANforge-IP with the IP of your LANforge system): rdesktop LANforge-IP
Log in with user/password lanforge/lanforge.
Once you are on the system, a console should already be open. If you don't see a console, go ahead and open one by clicking the console icon in the top menu bar (shown in the below screenshot).
Once you have a console ready, use the below commands to create a small or large file. These files will just contain random text. Note: These files will be created in the /home/lanforge directory. This is the default directory used for FTP on LANforge.
Small file (45 KB): dd if=/dev/urandom of=/home/lanforge/small-file.bin bs=1k count=44
Large file (10 MB): dd if=/dev/urandom of=/home/lanforge/large-file.bin bs=1k count=10240
Optional: Upload a file to the LANforge system for the FTP client to download/upload. There are multiple ways to do this, this step will demonstrate the upload using a Windows machine with FileZilla.
Near the top left in the Host field, enter in the following: sftp://LANforge-IP (sftp://192.168.100.86 is used in this example).
Username: lanforge Password: lanforge.
Click Quickconnect.
In the left column navigate to your file's directory. Make sure the right column is set to /home/lanforge
To start transferring your file, double click it in the left column. Once the transfer is complete make sure you can find it within the right column under /home/lanforge. Your file is now on the LANforge machine!
Create the FTP endpoint.
On the Layer 4-7 tab, click Create.
Configure the FTP endpoint.
Name your endpoint ftp-download.
Set Rpt Timer to fast (1 s)
Set Port to eth1.
Set URLs per 10m to 600 (1/sec).
Here is a list of common values used for URLS per 10m.
To download the small file (44KB) created earlier, set URL to: ftp://lanforge:lanforge@10.0.0.102/small-file.bin To download the large file (10MB) created earlier, set URL to: ftp://lanforge:lanforge@10.0.0.102/large-file.bin Note: The default directory for FTP is /home/lanforge and the default username/password is lanforge/lanforge. All files downloaded/uploaded via FTP need to be in /home/lanforge.
Optional: If you want to use another file in /home/lanforge you can just change the filename at the end of the URL. For example ftp://lanforge:lanforge@10.0.0.102/large-file.bin would be changed to ftp://lanforge:lanforge@10.0.0.102/your-file-name
Set Source/Dest File to /dev/null.
Click OK.
Start the endpoint and display the graph.
In the Layer 4-7 tab, select the connection called ftp-download.
Click Start.
Select ftp-download and click Display to see a graph similar to below.
Uploading a file from the FTP client to the FTP server.
Go to the Layer 4-7 tab and modify the ftp-download endpoint. The below changes will need to be made:
Name to ftp-upload.
UL/DL to Upload.
URL to ftp://lanforge:lanforge@10.0.0.102/upload-file. The 'upload-file' filename in this link can be changed if needed.
Source/Dest File to large-file.bin. This can be changed to a preferred file as long as it is in /home/lanforge (the default FTP directory).
Click OK.
Select ftp-upload and click Start.
This endpoint will now essentially upload the large-file.bin file in /home/lanforge to the same directory with a new file name (upload-file in this case). If you select ftp-upload in the Layer 4-7 tab and click Display, the graph should look similar to the one below.
Using SCP, SFTP, and TFTP.
Go to the Layer 4-7 tab and modify the ftp-download endpoint. The below changes will need to be made:
Name to ftp-scp for scp or ftp-sftp for sftp.
For SCP, set the URL to scp://lanforge:lanforge@10.0.0.102/~/small-file.bin. The filename at the end of the link can be changed to another file in /home/lanforge.
Click OK.
For SFTP, set the URL to sftp://lanforge:lanforge@10.0.0.102/~/small-file.bin. The filename at the end of the link can be changed to another file in /home/lanforge.
Click OK.
Select the ftp-scp or ftp-sftp endpoint and click Start.
To use TFTP, you will first need to have a TFTP server set up and configured to serve the Layer 4-7 endpoint a file.
Once the server is set up, use the below configuration to set up a TFTP endpoint. Note: You will need to provide your own server's IP and file name.
Set the Port to a port that can talk to the TFTP server. In this case the server was on the management network so eth0 was used.
URLs per 10m was left at the default 100, this can be set higher or lower depending on how often the file should be downloaded.