Firewall হলো একটি নিরাপত্তা ব্যবস্থা যা তোমার কম্পিউটার বা নেটওয়ার্ক এবং বাইরের পৃথিবীর মধ্যে একটি ফিল্টার হিসেবে কাজ করে। এটি নির্ধারণ করে কোন traffic ঢুকতে পারবে এবং কোনটা পারবে না।A Firewall is a security system that acts as a filter between your computer or network and the outside world. It determines which traffic can enter and which cannot.
ভাবো তোমার বাড়ির সামনে একজন নিরাপত্তারক্ষী আছে। সে প্রতিটা মানুষকে দেখে — পরিচিত হলে ঢুকতে দেয়, অপরিচিত বা সন্দেহজনক হলে আটকায়। Firewall ঠিক এভাবেই কাজ করে — শুধু মানুষের বদলে নেটওয়ার্ক traffic পরীক্ষা করে।Imagine a security guard at your front door. They check every person — letting in familiar faces and blocking strangers or suspicious people. A Firewall works exactly the same way — just checking network traffic instead of people.
ইন্টারনেট থেকে আসা traffic ↓ ┌──────────────────────────┐ │ 🔥 FIREWALL │ │ │ │ ✅ Port 80 (HTTP) → ALLOW │ │ ✅ Port 443 (HTTPS) → ALLOW │ │ ✅ Port 22 (SSH) → ALLOW │ ← নির্দিষ্ট IP থেকে │ ❌ Port 3306 (MySQL) → BLOCK│ │ ❌ Port 23 (Telnet) → BLOCK │ │ ❌ Unknown IP → BLOCK │ └──────────────────────────┘ ↓ তোমার নেটওয়ার্ক / Computer
Firewall নির্দিষ্ট Rules বা Policy অনুযায়ী traffic বিশ্লেষণ করে। প্রতিটি packet-এর জন্য:A Firewall analyzes traffic according to specific Rules or Policies. For each packet:
| Rule চেক করেRule Checks | উদাহরণExample | সিদ্ধান্তDecision |
|---|---|---|
| Source IP | 192.168.1.100 থেকে আসছে | ALLOW / BLOCK |
| Destination IP | 8.8.8.8-এ যাচ্ছে | ALLOW / BLOCK |
| Port Number | Port 80 (HTTP) | ALLOW / BLOCK |
| Protocol | TCP / UDP / ICMP | ALLOW / BLOCK |
| Direction | Inbound / Outbound | ALLOW / BLOCK |
| State | New / Established / Related | ALLOW / BLOCK |
সবচেয়ে পুরনো এবং সহজ Firewall। প্রতিটি packet-এর header (IP, Port, Protocol) দেখে সিদ্ধান্ত নেয়। Packet-এর ভেতরের content দেখে না।The oldest and simplest firewall. Makes decisions by looking at each packet's header (IP, Port, Protocol). Does not inspect the packet's content.
Packet আসলো: Source IP: 192.168.1.5 | Dest Port: 80 | Protocol: TCP ↓ Rule: Port 80 ALLOW → ✅ Pass Source IP: 192.168.1.5 | Dest Port: 3306 | Protocol: TCP ↓ Rule: Port 3306 BLOCK → ❌ Drop
আধুনিক এবং বেশি intelligent। শুধু packet header নয়, connection-এর stateও track করে। যেমন — একটা connection প্রতিষ্ঠা হয়েছে কিনা, packet কি সেই connection-এর অংশ।More modern and intelligent. Tracks not just packet headers but also connection state. For example — whether a connection is established, whether a packet is part of that connection.
State Table (Connection Tracking): ┌──────────────────┬────────────┬──────────┬───────────┐ │ Source IP:Port │ Dest IP:Port │ Protocol │ State │ ├──────────────────┼────────────┼──────────┼───────────┤ │ 192.168.1.5:49120│ 8.8.8.8:80 │ TCP │ ESTABLISHED│ │ 192.168.1.6:51200│ 1.1.1.1:443│ TCP │ SYN_SENT │ │ Unknown:4444 │ 192.168.1.5│ TCP │ BLOCKED │ └──────────────────┴────────────┴──────────┴───────────┘
OSI Model-এর Layer 7 (Application Layer) পর্যন্ত inspect করে। HTTP request-এর ভেতরে কী আছে সেটাও দেখতে পারে। SQL Injection, XSS এগুলো detect করতে পারে।Inspects up to OSI Model Layer 7 (Application Layer). Can see what's inside HTTP requests. Can detect SQL Injection, XSS and similar attacks.
সবচেয়ে আধুনিক Firewall। এতে আছে:The most modern firewall. It includes:
| Type | কাজWhat it does | OSI Layer | Speed | Security |
|---|---|---|---|---|
| Packet Filter | Header দেখেChecks headers | Layer 3-4 | দ্রুত | কম |
| Stateful | State track করেTracks state | Layer 3-4 | মাঝারি | মাঝারি |
| Application | Content দেখেChecks content | Layer 7 | ধীর | বেশি |
| NGFW | সব + AIAll + AI | All | ধীর | সর্বোচ্চ |
iptables তিনটি প্রধান Table এবং প্রতিটি Table-এ কয়েকটি Chain নিয়ে গঠিত।iptables consists of three main Tables and several Chains in each table.
Tables ও Chains: filter (default — traffic allow/block) ├── INPUT → তোমার সিস্টেমে আসা traffic ├── OUTPUT → তোমার সিস্টেম থেকে যাওয়া traffic └── FORWARD → তোমার সিস্টেম দিয়ে forward হওয়া traffic nat (Network Address Translation) ├── PREROUTING → আসার আগে modify ├── POSTROUTING → যাওয়ার আগে modify └── OUTPUT → local-generated packet mangle (packet modification) └── specialized packet alteration
UFW (Uncomplicated Firewall) হলো iptables-এর উপরে একটা simple wrapper। iptables-এর জটিল syntax-এর বদলে সহজ command দিয়ে কাজ করা যায়।UFW (Uncomplicated Firewall) is a simple wrapper around iptables. Instead of iptables' complex syntax, you work with simple commands.
ufw allow/deny [port] — সহজ rule যোগ করোVPN (Virtual Private Network) হলো একটি প্রযুক্তি যা তোমার ইন্টারনেট সংযোগকে এনক্রিপ্টেড টানেল-এর মাধ্যমে পাঠায়। এতে তোমার ISP, সরকার বা হ্যাকার তোমার traffic দেখতে পায় না এবং তোমার আসল IP address লুকিয়ে থাকে।VPN (Virtual Private Network) is a technology that routes your internet connection through an encrypted tunnel. This means your ISP, government or hackers can't see your traffic, and your real IP address stays hidden.
ভাবো তুমি একটা স্বচ্ছ কাচের রাস্তায় হাঁটছো — সবাই দেখতে পাচ্ছে। VPN হলো সেই রাস্তার নিচে একটা আন্ডারগ্রাউন্ড টানেল তৈরি করা — বাইরে থেকে কেউ দেখতে পাবে না তুমি কোথায় যাচ্ছো এবং কার সাথে কথা বলছো।Imagine walking on a transparent glass road — everyone can see you. VPN is like building an underground tunnel beneath that road — nobody outside can see where you're going or who you're communicating with.
VPN ছাড়া (Without VPN): তোমার PC → [Plain Text Traffic] → ISP দেখতে পায় → Internet → Website ↑ সরকার, হ্যাকার, ISP সব দেখতে পায় VPN সহ (With VPN): তোমার PC → [🔒 Encrypted Tunnel] → VPN Server → Internet → Website ↑ ↑ ISP শুধু VPN Server VPN Server তোমার হয়ে দেখতে পায় request করে Website যা দেখে: Real IP: X.X.X.X (তোমার) → VPN IP: Y.Y.Y.Y (VPN Server)
Step 1: তোমার PC ও VPN Server-এর মধ্যে Keys exchange হয় (TLS Handshake / Key Agreement) Step 2: তোমার data Encrypt হয়: "GET / HTTP/1.1" ↓ AES-256 Encryption "Xk#9@mP$2nQ!vR5..." ← কেউ পড়তে পারবে না Step 3: VPN Server Decrypt করে website-এ পাঠায় Step 4: Response আবার Encrypt হয়ে তোমার কাছে আসে
VPN Protocol হলো VPN connection তৈরি ও data encrypt করার পদ্ধতি। বিভিন্ন protocol-এর speed, security ও compatibility আলাদা।A VPN Protocol is the method used to create a VPN connection and encrypt data. Different protocols vary in speed, security and compatibility.
| Protocol | Speed | Security | Port | ব্যবহারUse For |
|---|---|---|---|---|
| WireGuard | ⚡ দ্রুততম | ✅ উচ্চ | UDP 51820 | Personal, Mobile |
| OpenVPN | মাঝারি | ✅ সর্বোচ্চ | 443/1194 | Business, Security |
| IKEv2/IPSec | দ্রুত | ✅ উচ্চ | UDP 500 | Mobile, Enterprise |
| L2TP/IPSec | মাঝারি | ঠিক আছে | UDP 1701 | Legacy systems |
| PPTP | দ্রুত | ❌ দুর্বল | TCP 1723 | ব্যবহার করো নাAvoid |
| SSTP | মাঝারি | ✅ ভালো | TCP 443 | Windows only |
Proxy Server হলো একটি মধ্যস্থতাকারী সার্ভার যা তোমার এবং ইন্টারনেটের মধ্যে বসে। তুমি সরাসরি website-এ যাওয়ার বদলে proxy-তে যাও, proxy তোমার হয়ে website-এ যায় এবং response এনে তোমাকে দেয়।A Proxy Server is an intermediary server that sits between you and the internet. Instead of going directly to a website, you go to the proxy, and the proxy visits the website on your behalf and returns the response to you.
ভাবো তুমি একটা দোকানে যেতে চাও কিন্তু তোমার পরিচয় লুকাতে চাও। তাই তুমি একজন দূত পাঠালে — দূত দোকানে গিয়ে জিনিস কিনে তোমার কাছে নিয়ে আসে। দোকান দূতকে চেনে, তোমাকে নয়। Proxy ঠিক এভাবে কাজ করে।Imagine you want to visit a shop but want to hide your identity. So you send a messenger — the messenger goes to the shop, buys things and brings them to you. The shop knows the messenger, not you. A Proxy works exactly this way.
Proxy ছাড়া: তোমার PC ──────────────────────────→ Website IP: 203.0.113.5 দেখায় Proxy সহ: তোমার PC ──→ Proxy Server ──────────→ Website IP: 198.51.100.7 (Website Proxy IP দেখে, তোমার IP নয়) Website ──→ Proxy ──→ তোমার PC Response ফেরত আসে
| বিষয়Feature | VPN | Proxy |
|---|---|---|
| Encryption | ✅ সম্পূর্ণ | ❌ সাধারণত নেই |
| IP Masking | ✅ হ্যাঁ | ✅ হ্যাঁ |
| Speed | ধীর (overhead) | দ্রুত |
| সব trafficAll traffic | ✅ System-wide | ❌ শুধু configured app |
| Setup | জটিল | সহজ |
| Cost | সাধারণত paid | অনেক free |
| Security | উচ্চ | মাঝারি |
সবচেয়ে সাধারণ proxy। Client-এর হয়ে internet-এ যায়। Client-এর IP লুকায়।The most common proxy. Goes to the internet on behalf of the client. Hides the client's IP.
Client → Forward Proxy → Internet ব্যবহার: Corporate filtering, anonymity, geo-bypass
Client-এর জন্য নয়, Server-এর সামনে থাকে। ইন্টারনেট থেকে আসা request receive করে এবং পেছনের server-এ পাঠায়। Server-এর IP লুকায়।Not for the client, it sits in front of the server. Receives requests from the internet and forwards them to backend servers. Hides the server's IP.
Internet → Reverse Proxy → Backend Server(s) ব্যবহার: Load balancing, DDoS protection, SSL termination, caching উদাহরণ: Nginx, Apache, Cloudflare, HAProxy
ব্যবহারকারী জানেই না যে proxy ব্যবহার হচ্ছে। ISP এবং corporate network-এ ব্যাপকভাবে ব্যবহার হয় traffic filter করতে এবং cache করতে।The user doesn't even know a proxy is being used. Widely used by ISPs and corporate networks to filter traffic and for caching.
SOCKS5 হলো সবচেয়ে flexible proxy protocol। HTTP-র বাইরেও TCP/UDP যেকোনো traffic handle করতে পারে। Authentication support আছে।SOCKS5 is the most flexible proxy protocol. Can handle any TCP/UDP traffic beyond just HTTP. Supports authentication.
Squid হলো সবচেয়ে জনপ্রিয় open-source Forward Proxy। এটি caching, content filtering এবং access control-এর জন্য ব্যাপকভাবে ব্যবহৃত হয়।Squid is the most popular open-source Forward Proxy. It's widely used for caching, content filtering and access control.
Burp Suite Proxy হলো একটি intercepting proxy যা Browser এবং Server-এর মধ্যে বসে HTTP/HTTPS traffic দেখে ও modify করে। Web security testing-এর জন্য অপরিহার্য।Burp Suite Proxy is an intercepting proxy that sits between the browser and server to view and modify HTTP/HTTPS traffic. Essential for web security testing.
Browser ←→ Burp Proxy (127.0.0.1:8080) ←→ Web Server ↑ তুমি এখানে traffic দেখো ও বদলাও
Port Knocking হলো একটি নিরাপত্তা কৌশল যেখানে নির্দিষ্ট port-গুলোতে নির্দিষ্ট ক্রমে "knock" করলে তবেই firewall port খোলে।Port Knocking is a security technique where ports only open after "knocking" on specific ports in a specific sequence.
Tor (The Onion Router) হলো একটি anonymity network যেখানে traffic একাধিক server (node) এর মধ্য দিয়ে যায়, প্রতিটিতে একটি layer of encryption যোগ হয়। পেঁয়াজের মতো layer-by-layer।Tor (The Onion Router) is an anonymity network where traffic passes through multiple servers (nodes), with a layer of encryption added at each. Layer by layer like an onion.
তোমার PC → [Entry Node] → [Middle Node] → [Exit Node] → Website শুধু তোমার IP শুধু Entry IP শুধু Middle IP জানে জানে জানে কোনো single node সম্পূর্ণ path জানে না
| বিষয়Feature | VPN | Proxy | Tor |
|---|---|---|---|
| Encryption | ✅ Strong | ❌ Usually None | ✅ Multi-layer |
| IP Masking | ✅ হ্যাঁ | ✅ হ্যাঁ | ✅ উচ্চতর |
| Speed | মাঝারি | দ্রুত | অনেক ধীর |
| Anonymity | ভালো | কম | সর্বোচ্চ |
| Cost | Paid সাধারণত | Free অনেক | Free |
| Trust | VPN Provider | Proxy Provider | Distributed |
| Use Case | Privacy, Streaming | Bypassing, Caching | Max Anonymity |
একটা company-র নেটওয়ার্ক কাঠামো: Internet ←→ Router ←→ Firewall (NGFW) ↓ ┌─────────┴─────────┐ ↓ ↓ DMZ Zone Internal LAN Web Server Workstations Mail Server File Server Database Server VPN Server ←→ Firewall ↑ Remote Workers (WireGuard/OpenVPN)
| ধাপStep | বিষয়Topic | Tools | সময়Time |
|---|---|---|---|
| ১ | Networking Basics (OSI, TCP/IP, Ports) | Wireshark | ১ সপ্তাহ |
| ২ | UFW দিয়ে Basic Firewall | UFW, Ubuntu VM | ৩ দিন |
| ৩ | iptables গভীরভাবে | iptables, Linux | ১ সপ্তাহ |
| ৪ | WireGuard VPN Setup | WireGuard, VPS | ১ সপ্তাহ |
| ৫ | Proxy Types ও ProxyChains | Squid, ProxyChains | ৫ দিন |
| ৬ | Burp Suite Proxy | Burp Suite | ১ সপ্তাহ |
| ৭ | NGFW ও Enterprise Solutions | pfSense, OPNsense | ২ সপ্তাহ |
| ৮ | OpenVPN Server Setup | OpenVPN, Easy-RSA | ১ সপ্তাহ |
🔥 "Security is not a product, it's a process." 🌐
প্রতিটি command নিজে চালাও — শুধু পড়লে শেখা হয় না।Run every command yourself — just reading isn't enough.
Firewall · VPN · Proxy Guide — v1.0 | 14 Chapters | Zero to Advanced