🔥 Firewall & VPN Concepts – Overview
Network security relies heavily on Firewalls and VPNs to control traffic, block threats, and provide secure communication across public networks.
🧱 1. Firewall – Basics
A firewall is a security device (hardware or software) that monitors and controls incoming and outgoing network traffic based on predefined security rules.
🎯 Purpose of a Firewall
- Block unauthorized access
- Allow safe, trusted traffic
- Protect internal networks from external threats
🔑 Types of Firewalls
1️⃣ Packet Filtering Firewall
- Oldest & simplest
- Checks IP, port, protocol
- Fast but less secure
2️⃣ Stateful Inspection Firewall
- Tracks active connections
- More secure than packet filtering
3️⃣ Proxy Firewall
- Works as a middleman
- Hides internal network
- Slower but highly secure
4️⃣ Next-Generation Firewall (NGFW)
- Deep packet inspection
- Application-level filtering
- Malware/Intrusion prevention
🔄 Firewall Deployment Types
- Network Firewalls: Protect entire networks
- Host-based Firewalls: Protect individual devices
- Cloud Firewalls: Used in cloud environments
🚫 What Firewalls Protect Against
- Unauthorized access
- Malware connections
- DoS traffic (partial protection)
- Suspicious outbound connections
🔓 Firewall Limitations
- Cannot block attacks from inside
- Cannot detect encrypted malicious traffic (without DPI)
- Cannot stop social engineering attacks
🌐 2. VPN (Virtual Private Network) – Basics
A VPN creates a secure, encrypted communication tunnel over the internet, allowing remote users to access network resources safely.
🎯 Purpose of a VPN
- Encrypt data
- Protect privacy
- Secure remote access
- Hide IP addresses
🧩 How VPN Works
- User connects to VPN client
- Client encrypts data
- Data travels through a secure tunnel
- VPN server decrypts it and sends to destination
- Reverse happens for incoming data
🔐 Types of VPN
1️⃣ Remote Access VPN
Used by employees to connect to the office network from home.
2️⃣ Site-to-Site VPN
Connects two office networks over the internet.
3️⃣ Client-to-Site VPN
Individual user → corporate network.
🔑 VPN Protocols
1. PPTP (Old & Less Secure)
Fast, outdated.
2. L2TP/IPSec
More secure; adds encryption using IPSec.
3. OpenVPN
Highly secure, uses SSL/TLS.
4. IKEv2/IPSec
Strong security & stable for mobile networks.
5. WireGuard
New, fast, secure, modern protocol.
🛡️ Encryption in VPN
- AES-256 (strongest standard)
- RSA for key exchange
- SHA for hashing
🔍 Firewall vs VPN – Key Differences
| Feature | Firewall | VPN |
|---|---|---|
| Purpose | Block/allow traffic | Secure/encrypt traffic |
| Protects | Entire network | Data transmission |
| Works at | Network perimeter | User-to-server tunnel |
| Security | Access control | Privacy & encryption |
💼 Real-World Use Cases
- Companies using VPN for remote employees
- Firewalls protecting corporate networks
- NGFW preventing malware & intrusion
- Site-to-site VPN connecting branch offices