Transferring Files with FTP

Ch. 5 of 514 mins3 Tasks

Run an FTP file server, connect from an office computer, and upload and download files using two network channels.

Track Series

Chapters in this Track (Ch. 5 of 5)

5Transferring Files with FTP
14m

While web browsers are great for reading pages, companies need dedicated ways to move big files across the network. Network engineers need to save backup copies of switch settings, send software updates to routers, and let employees share documents in a shared folder. For many years, the standard tool for this job has been the File Transfer Protocol (FTP).

Unlike simple web downloads, FTP is built specifically for reliable file storage. It lets users list folders, create directories, and transfer large documents between local computers and central servers.

Two Channels for Commands and Files

Most network protocols use a single connection for everything. FTP is unusual and smart: it creates two completely separate network links between your computer and the server:

  1. Control Channel (Port 21): When you log in, your computer opens a connection to server Port 21. This channel stays open during your whole session. It only carries short text commands—such as your username, password, and folder navigation (dir, cd). It never carries file contents.
  2. Data Channel (Port 20 or Temporary Port): The moment you ask to download a document or upload a configuration file, FTP opens a second connection just for that file. As soon as the file finishes moving across the cable, this second connection closes. Your original command channel stays open, ready for your next instruction.
Channel Port Used What Goes Through It
Command Channel Port 21 Login details, folder browsing, and file commands.
Data Channel (Active) Port 20 The server opens an incoming connection to send the raw file.
Data Channel (Passive) Temporary Port (>1024) Your PC opens an outbound connection to download through firewalls.

Splitting commands and data into separate channels provides a huge operational advantage: if you start downloading a multi-gigabyte operating system image and realize you picked the wrong file, you can immediately send an abort signal across the command channel without hanging your terminal or dropping the entire network connection.

Active vs. Passive Mode: Working with Firewalls

In early computer networks, FTP used Active Mode. The client told the server: "Send the file to my computer on port 50000", and the server reached back into the client computer. But modern office firewalls block unexpected incoming connections from outside servers.

To fix this, modern networks use Passive Mode (PASV). In passive mode, the client tells the server: "Tell me which port you are listening on, and I will connect to you." Because the client initiates the connection outward, office firewalls allow the data channel through without blocking the file.

Common FTP Commands You Will Use

When you connect to an FTP server through a terminal window, you interact using simple, powerful commands:

  • ftp 192.168.1.50: Opens the initial command channel to the server on Port 21.
  • dir or ls: Requests a list of available files and folders stored on the server.
  • get filename.txt: Downloads a specific file from the server directly to your local computer.
  • put backup-config.cfg: Uploads a local file from your machine to the central server.
  • bye or quit: Closes both network channels cleanly.

Whether you work with an interactive graphical client like FileZilla or write shell automation scripts in a Linux terminal, these core FTP commands run under the hood. In your practice lab on the right, you can inspect the central server's storage repository and verify network connectivity.

Field Story: The Half-Dead FTP Session

A classic support ticket in network administration is: "I can log into the FTP server, but the moment I type 'dir' or try to download a file, the window freezes."

This happens when the command channel on Port 21 is open, but an office firewall or router blocks the data channel. The user can log in and send commands, but no directory list or file can pass through. Switching your FTP client to Passive Mode solves this problem immediately.

Graduating from Local Network Services

You have now explored the core application pillars that power every office on the planet: client-server socket communication, hosting web intranets with HTTP, looking up names with DNS, automating IP delivery with DHCP, and centralizing files with FTP.

With these foundational services running smoothly, our attention turns to scaling the office. How do you protect different departments from seeing each other's traffic on the same physical switch? Jump directly into Campus Switching and VLANs to master virtual local area networks, 802.1Q trunks, and port security.

Hands-On Practice Checklist

Progress:0 / 3

Perform actions on the practice lab canvas on the right. Tasks automatically check off as you connect cables and run commands.

Task 1: Inspect Server FTP Service Configuration

Click Central Services Server on the canvas, switch to the Services tab, click FTP, and verify that the FTP Service daemon is active on TCP Port 21.

Task 2: Verify File Repository Contents

Under the Server FTP tab, review the available files in the server storage repository (configuration backups, firmware images, and corporate documents).

Task 3: Test Connectivity to Central Storage Server

Open Workstation PC-1 Terminal and run "ping 192.168.1.50" to ensure full Layer 3 reachability to the FTP storage daemon.