🌐 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






💻 Configuring FTP in Cisco Packet Tracer

To simulate file transfer between systems, we can use Cisco Packet Tracer. The setup includes:

  1. Add an FTP Server and PCs.

  2. Assign IP addresses and verify connectivity using ping.

  3. 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.

  4. On the Client PC:

    • Open the Command Prompt and type:

      ftp <server-ip>
    • Enter the username and password.

    • Use commands to view, upload, or download files.


           
This network topology connects two PCs (192.168.0.2 and 192.168.0.3) through a switch to a router with the gateway address 192.168.0.1. The router links the local network to an external FTP server with the IP 37.0.0.2 via the router’s external interface (37.0.0.1). This setup allows the PCs in the local LANto communicate with the FTP server for file transfer services over different networks.





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

ftp 37.0.0.2
  • 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

put hello.txt
  • 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

ftp 37.0.0.2
  • 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

put hello.txt
  • 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

  1. Control Connection (Port 21)

    • All commands (login, directory navigation, file operations) are communicated over a control connection. 

  2. 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. 

  3. 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). 

  4. 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:

  1. Client → Server (port 21): Control connection established.

  2. 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:

  1. Client → Server (port 21): Control connection established.

  2. 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