Chapter 35 of 41

Firewalls, Proxy & VPN

When we connect our devices to a network or the Internet, we don't want every connection to have unrestricted access to our systems or data.

To control and protect network communication, we commonly use technologies such as Firewalls, Proxies, and VPNs.

Although all three are related to network security, they solve different problems.

In simple terms:

Firewall → Controls network traffic.

Proxy → Acts as an intermediary for application traffic.

VPN → Creates a protected tunnel between network endpoints.

Let's understand each one.


What Is a Firewall?

A firewall is a security system that monitors and controls network traffic according to predefined rules.

It can allow legitimate traffic and block traffic that is not permitted.

Internet
   ↓
Firewall
   ↓
Internal Network

For example, an organization may configure a firewall to allow web traffic to a public web server while blocking unauthorized incoming connections to internal systems.


How Does a Firewall Work?

A firewall examines traffic and compares it with its security rules.

A simplified example:

Incoming Traffic
       ↓
    Firewall
       ↓
   Check Rules
     /      \
  Allow     Block
    ↓         ↓
 Network     Drop

Firewall rules can consider information such as:

  • Source IP address

  • Destination IP address

  • Port

  • Protocol

  • Connection state

  • Application information, depending on the firewall


Types of Firewalls

Firewalls can be implemented in different ways.

Packet-Filtering Firewall

Examines individual packets and makes decisions based on fields such as addresses, ports, and protocols.

Stateful Firewall

Tracks the state of network connections and uses that information when making filtering decisions.

Application-Aware Firewall

Can inspect traffic at a higher level and apply rules based on applications or protocols.

Network Firewall

Protects traffic between networks, such as an organization's internal network and the Internet.

Firewalls can also be implemented directly on individual computers as host-based firewalls.


What Is a Proxy?

A proxy server is an intermediary that receives requests from a client and makes requests to another server on the client's behalf.

Instead of:

Client ─────────→ Website

the communication can look like:

Client ──→ Proxy ──→ Website
             ↑
        Intermediary

The proxy can inspect, modify, filter, cache, or log traffic depending on its configuration and purpose.


Example of a Proxy

Imagine a company has many employees accessing websites.

Instead of allowing every computer to connect directly to the Internet, the organization can route web traffic through a proxy.

Employee PCs
     ↓
   Proxy
     ↓
 Internet

The organization may use the proxy to:

  • Apply access policies

  • Log requests

  • Filter content

  • Cache frequently requested resources

  • Control outbound web traffic


Forward Proxy vs Reverse Proxy

There are two important types of proxies.

Forward Proxy

A forward proxy acts on behalf of clients.

Client → Forward Proxy → Internet Server

The client is aware that it is using the proxy.

Forward proxies are commonly used in organizations to control or monitor outbound traffic.

Reverse Proxy

A reverse proxy acts on behalf of servers.

Client → Reverse Proxy → Web Server

The client communicates with the reverse proxy, which then forwards the request to the appropriate backend server.

Reverse proxies are commonly used for:

  • Load balancing

  • TLS termination

  • Caching

  • Web application protection

  • Hiding backend infrastructure


What Is a VPN?

VPN (Virtual Private Network) is a technology that creates a protected communication tunnel between network endpoints over another network.

For example:

Laptop ═════ Protected Tunnel ═════ VPN Server

The tunnel can protect traffic from being read or modified while it travels across an untrusted network, depending on the VPN protocol and configuration.


How Does a VPN Work?

Suppose you are connected to a public network.

Without a VPN:

Your Device ───── Public Network ───── Internet

With a VPN:

Your Device ═══ Encrypted Tunnel ═══ VPN Server
                                      ↓
                                   Internet

The VPN encrypts traffic between your device and the VPN endpoint according to the VPN protocol.

The VPN server then forwards traffic toward its destination.


Why Use a VPN?

VPNs can be useful for:

  • Securely connecting to an organization's network

  • Protecting traffic across untrusted networks

  • Connecting remote offices

  • Providing remote access to internal resources

  • Creating secure site-to-site connections

For example, an employee working remotely may use a VPN to securely access internal company systems.


Firewall vs Proxy vs VPN

This is the most important comparison.

Feature

Firewall

Proxy

VPN

Main Purpose

Control network traffic

Act as an intermediary

Create a protected tunnel

Main Role

Filter

Forward/mediate

Tunnel

Common Use

Network protection

Traffic control/caching

Secure remote connectivity

Can Filter Traffic?

Yes

Often

Depends on configuration

Encrypts Traffic?

Not inherently

Not inherently

Typically protects the VPN tunnel

Works At

Various layers

Often application layer

Network or link layer, depending on technology


Simple Real-Life Analogy

Let's use a building analogy.

Firewall → Security Guard

A security guard checks who is allowed to enter or leave.

Person → Security Guard → Building

The firewall checks network traffic against security rules.

Proxy → Receptionist

A receptionist receives a request and passes it to the appropriate person.

You → Receptionist → Employee

A proxy receives requests and forwards them on behalf of clients or servers.

VPN → Private Tunnel

Imagine a secure tunnel connecting two buildings.

Building A ═════ Secure Tunnel ═════ Building B

A VPN creates a protected communication path across another network.


Can They Be Used Together?

Absolutely.

A real organization might use all three:

Employee
   ↓
VPN
   ↓
Firewall
   ↓
Proxy
   ↓
Internet

For example:

  • VPN provides secure remote connectivity.

  • Firewall controls which traffic is allowed.

  • Proxy manages specific application traffic.

Each technology has a different responsibility.


Important Difference: VPN vs Proxy

VPNs and proxies are often confused because both can act as intermediaries.

But they are not the same.

A proxy generally handles traffic for particular applications or protocols configured to use it.

A VPN generally creates a protected tunnel at a lower networking level, allowing many types of IP traffic to travel through the tunnel.

Also, a VPN does not automatically make the destination website anonymous or trustworthy. It mainly changes how traffic is routed and protected between your device and the VPN endpoint.

Conclusion

Firewalls, proxies, and VPNs are important networking and security technologies, but they serve different purposes.

Firewall

Controls and filters network traffic according to security rules.

Proxy

Acts as an intermediary between clients and servers.

VPN

Creates a protected tunnel between network endpoints.

The easiest way to remember them is:

🛡 Firewall → Control

🔄 Proxy → Intermediary

🔐 VPN → Protected Tunnel

Understanding these three concepts gives you a strong foundation for learning more advanced topics such as network access control, reverse proxies, VPN protocols, intrusion prevention, and enterprise network security.