🌐 Introduction
FTP (File Transfer Protocol) is one of the oldest and most reliable methods for transferring files between computers over a network. It allows users to upload, download, and manage files on remote servers.
In this blog, we will:
-
Configure FTP services in Cisco Packet Tracer
-
Understand the working of FTP and its modes
-
Learn about FTP commands and operations
To simulate file transfer between systems, we can use Cisco Packet Tracer. The setup includes:
-
Add an FTP Server and PCs.
-
Assign IP addresses and verify connectivity using ping.
-
On the FTP Server:
-
Enable the FTP service under the Services tab.
-
Create user accounts with usernames and passwords.
-
Add files in the server directory for access.
-
-
On the Client PC:
-
Open the Command Prompt and type:
-
Enter the username and password.
-
Use commands to view, upload, or download files.
FTP Server User Access
Step 1: User Identification
-
The server provides a secure login page for file services.
-
Each authorized user is assigned a unique username.
Step 2: Authentication
-
Users must enter both username and password to gain access.
-
This ensures only verified users can connect to the server.
Step 3: Secure Access to File Services
-
After successful login, users can upload, download, and manage files.
-
Access is monitored to maintain data integrity and security.
Step 4: Confidentiality & Security
-
Login details must remain confidential.
-
The server enforces authentication to protect organizational resources.
Using FTP Commands
Step 1: Connect to the FTP Server
-
This command establishes a connection from the client (PC) to the FTP server with IP address 37.0.0.2.
-
The user will be prompted to enter username and password for authentication.
Step 2: Upload a File to the Server
-
This command uploads the file hello.txt from the local machine to the FTP server.
-
Once uploaded, the file becomes accessible to authorized users on the server.
FTP File Upload Process
Step 1: Connect to the FTP Server
-
Initiates a connection to the FTP server at IP 37.0.0.2.
-
The user is prompted to enter their username and password for authentication.
-
Upon successful login, the user gains access to the server’s file system.
Step 2: Upload a File to the Server
-
Transfers the local file hello.txt from the client system to the FTP server.
-
The command ensures the file is placed in the user’s directory on the server.
-
A confirmation message such as “Transfer complete” is displayed once the upload finishes successfully.
How FTP Works
-
Control Connection (Port 21)
-
All commands (login, directory navigation, file operations) are communicated over a control connection.
-
-
Data Connection (Port 20 or dynamic port)
-
For each file transfer, a separate data connection is opened (or reused), over which actual file content is sent.
-
-
Modes: Active vs Passive
-
Active mode: server connects back to client’s data port.
-
Passive mode: client initiates both control and data connections to server ports (better for firewall/NAT traversal).
-
-
Session Lifecycle
-
Connect → Authenticate (USER / PASS) → Execute commands (PUT, GET, LIST, etc.) → Terminate (QUIT or BYE)
Security Considerations & Upgrades
-
Plain FTP is insecure: credentials and file content are sent in clear text, vulnerable to sniffing.
-
Use FTPS (FTP over TLS/SSL) or SFTP (FTP over SSH) for encrypted transfer. Be cautious about FTP bounce attacks, where malicious users exploit the PORT command to scan or access unintended hosts.
🔄 Active vs Passive FTP
📌 Active FTP
-
In Active mode, the client opens a control connection (TCP port 21) to the server.
-
Then the server actively opens a data connection from its port 20 to a random port on the client.
-
Issue: Many clients are behind firewalls/NAT, so incoming connections from server are often blocked.
👉 Flow:
Client → Server (port 21): Control connection established.
-
Server → Client (random port): Data connection opened.
📌 Passive FTP
-
In Passive mode, the client initiates both connections (control + data).
-
After control connection is established on port 21, the client requests passive mode.
-
Server then provides an IP and port (random high port) for data connection.
-
Client opens data connection to that port.
👉 Flow:
-
Client → Server (port 21): Control connection established.
-
Client → Server (random port): Data connection opened.
✅ Conclusion
This project demonstrates how FTP enables reliable file transfer across different networks using a client–server model. By configuring the LAN, router, and external server, we successfully connected local PCs to upload files with simple commands. The process highlights FTP’s role in real-world data sharing, while also emphasizing its importance in understanding basic networking and application layer protocols.
Comments
Post a Comment