Week 5 - Lab Instructions - FTP Server Configuration
Week 5 - Lab Instructions - FTP Server Configuration
Computer
Networks
Products
Lecturer:
Dr. Hamidreza Bagheri
2024-2025
FTP Protocol
Background
FTP stands for File Transfer Protocol; it is a client/server protocol for sending files to and
from a host computer. Although transferring files from one system to another seems simple
and straightforward, some problems must be dealt with first. For example, two systems may
use different file name conventions. Two systems may have different ways to represent text
and data. Two systems may have different directory structures. All these problems have been
solved by FTP in a very simple and elegant approach. FTP has been around for a long time
and while its popularity has decreased since the introduction of cloud services, it is still
commonly used by administrators for file uploads to the web server and file data
transfer/backups to FTP servers.
FTP differs from other client-server applications in that it establishes two connections
between the hosts. One connection is used for data transfer, the other for controlling
information (commands and responses). Separation of commands and data transfer makes
FTP more efficient. The control connections use very simple rules of communication. We need
to transfer only a line of command or a line of response at a time. The data connection, on the
other hand, needs more complex rules due to the variety of data types transferred.
FTP uses two well-known TCP ports: Port 21 is used for the control connection, and port 20
is used for the data connection. The figure below shows the basic model of FTP.
The client has three components: user interface, client control process, and the client data
transfer process. The server has two components: the server control process and the server
data transfer process. The control connection is made between the control processes. The
data connection is made between the data transfer processes.
The control connection remains connected during the entire interactive FTP session. The data
connection is opened and then closed for each file transferred. It opens each time commands
that involve transferring files are used, and it closes when the file is transferred. In other
words, when a user starts an FTP session, the control connection opens. While the control
connection is open, the data connection can be opened and closed multiple times if several
files are transferred.
FTP is a connection-oriented protocol that is used to transfer files between host devices and
servers. This type of transfer is used for unsensitive data because security is not important
1|Page
for FTP. Although it is not a real secure protocol, it supports authentication. But there is no
encryption in FTP transfer.
The Secure File Transfer Protocol (SFTP) is a file transfer protocol that allows you to send
huge files over the Internet. It is based on FTP and contains Secure Shell (SSH) security
components. SSH is an Internet security cryptography component. For cases where sensitive
data needs to be protected, SFTP can be helpful. The SFTP protocol is only utilized when the
user logs into the server using SSH to avoid leaving other ports open or maintaining
additional authentications. Both communication participants must identify with an SFTP
server by providing a user ID and password or confirming an SSH key. The two clients'
computers keep one half of the SSH key while the server loads the other half and associates
it with their accounts (public key). Authentication is only possible when the SSH key pair
matches.
FTP relies on two communications channels between the client and server: a command
channel for controlling the conversation and a data channel for transmitting file content.
Command channel: This is the control connection. It is used for sending and receiving
commands and responses. Typically, a user needs to log on to the FTP server for establishing
the connection but there are some servers that make all their content available without login.
These servers are known as anonymous FTP. Data channel (Connection): For transferring the
files and folder we use a separate connection called data connection.
A user typically needs to log on to the FTP server, although some servers make some or all
their content available without login, a model known as anonymous FTP. The client initiates
a conversation with the server when the user requests to download a file. Using FTP, a client
can upload, download, delete, rename, move and copy files on a server.
FTP sessions work in active or passive modes in the following ways: Active mode: After a
client initiates a session via a command channel request, the server creates a data connection
back to the client and begins transferring data. Passive mode: The server uses the command
channel to send the client the information it needs to open a data channel. Because the client
is initiating all connections in passive mode, it works well across firewalls and Network
Address Translation (NAT) gateways.
2|Page
FTP Configuration in Packet Tracer
In this section, we are going to design an FTP server configuration in cisco packet tracer
and check the connectivity for uploading and downloading the file from remote PC.
Objectives:
• To Configure FTP Services on Server.
• To Upload a File into the FTP Server from Remote PC.
• To Download a File from the FTP Server from Remote PC.
1. Select a 2911 Router from Network Devices and drag and drop to the workspace.
2. Select Router0 and Go to Config.
3. Configure the GigabitEthernet0/0 by assigning IP address as 192.168.1.1 and subnet
mask as 255.255.255.0 and turn on the port status.
4. Configure the GigabitEthernet0/1 by assigning IP address as 10.0.0.1 and subnet mask
as 255.0.0.0 and turn on the port status.
Router0 CLI:
Router>enable
Router#
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface GigabitEthernet0/0
Router(config-if)#ip address 192.168.1.1 255.255.255.0
Router(config-if)#exit
Router(config)#interface GigabitEthernet0/1
Router(config-if)#ip address 10.0.0.1 255.0.0.0
Router(config-if)#shutdown
Router(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface
GigabitEthernet0/0, changed state to up
%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to
up
3|Page
%LINEPROTO-5-UPDOWN: Line protocol on Interface
GigabitEthernet0/1, changed state to up
1. Select two PC-PT type PCs from End devices and drag and drop to the workspace.
2. Select PC0 and go to FastEthernet0 in config and assign IP address and subnet mask for
the PC0 as 192.168.1.2, 255.255.255.0
3. Select PC1 and go to FastEthernet0 in config and assign IP address and subnet mask for
the PC1 as 192.168.1.3, 255.255.255.0
4. For both the PCs (PC0, PC1) go to Global settings in config and Assign default gateway as
192.168.1.1
1. Select a server from End devices and drag and drop to the workspace.
2. Go to the global settings in config and assign default gateway as 10.0.0.1
3. Go to FastEthernet0 and assign IP address and subnet mask as 10.0.0.2, 255.0.0.0
4. Go to services and open FTP Service.
5. Go to the user setup and create a username and password.
6. Select all the permissions (Write, Read, Delete, Rename, List) and add the user.
User setup:
4|Page
1. Select a 2950-24 Switch from the network devices and drag and drop to the workspace.
2. Connect FastEthernet0 port of PC0 to the FastEthernet0/1 port of switch0 using
Copper Straight-Through cable.
3. Connect FastEthernet0 port of PC1 to the FastEthernet0/2 port of switch0 using
Copper Straight-Through cable.
4. Connect FastEthernet0/3 port of switch0 to the GigabitEthernet0/0 of Router0 using
Copper Straight-Through cable.
5. Connect GigabitEthernet0/1 port of Router0 to the FastEtherner0 of server0 using
Copper Straight-Through cable.
2911
192.168.1.1 255.255.255.0 10.0.0.1 255.0.0 0
Router0
PC Configuration Table:
5|Page
Checking connections from PC0 to the other hosts in the network using ping command in
Command Prompt.
Checking connections from PC1 to the other hosts in the network using ping command in
Command Prompt.
Creating a file named 2.txt for writing (uploading) into FTP Server.
6|Page
Writing (uploading) the file named 2.txt into FTP Server from PC0 using put 2.txt command
and verifying this file transfer using dir command.
Reading (Downloading) the file named 2.txt present in FTP Server from PC1 using get 2.txt
command and verifying this file transfer using dir command.
7|Page
Simple Client Server FTP
Follow these steps:
Step 3: Now try using an FTP client built in the laptop to send files to an FTP
server configured in the Server.
8|Page
From the laptop’s command prompt, FTP the server using the server IP address by typing:
ftp 192.168.1.2
Provide the username (cisco) and password (cisco) [which are the defaults] for ftp login.
Step 4: Create a file in the laptop then upload it to the server using FTP
Open the Text Editor in the laptop, create a file and give it your name of choice. Type any text
in the editor then save your file. e.g. myFile.txt.
Step 5: Now upload the file from the laptop to the server
An FTP connection needs to be started first, as this is what we have done in Step 3. To do an
FTP upload, type:
put MyFile.txt
9|Page
10 | P a g e