Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> ระบบเครือข่าย >> ความปลอดภัยเครือข่าย

สร้าง Network Security Appliance (Firewall/UTM) ฟรีด้วยตัวเอง: OPNsense, pfSense, Endian

Free/Open Source Firewall & UTM Platforms

PlatformBase OSLicenseจุดเด่นเหมาะสำหรับ
OPNsenseHardenedBSD (FreeBSD)BSD (Open Source)UI สวยง่าย ใช้ง่าย Update บ่อย HardenedBSD Security Plugins มากHome Lab, SMB, Enterprise
pfSense (CE)FreeBSDApache 2.0 (Open Source)Community ใหญ่ที่สุด Docs เยอะมาก Stable (ZFS) Multi-WAN/Load BalancingHome Lab, SMB, ISP, Enterprise
Endian Firewall CommunityLinux (Debian-based)GPL (Open Source)UTM All-in-one: AV, Proxy, VPN, IDS, Content Filter Web UI เรียบง่ายHome, Small Office
IPFireLinux (LFS)GPLHardened Linux, Package System (Pakfire), Zone-based (Red/Orange/Blue/Green)Home, SMB, Education
Untangle NG Firewall (Free)DebianProprietary (Free Tier)App-based Modules, Web UI ดี, Free version จำกัด FeaturesHome, Small Business

OPNsense vs pfSense: เลือกอันไหนดี?

  • OPNsense: UI/UX ใหม่กว่า, HardenedBSD (Security Hardening), Release Cycle เร็วกว่า (6 เดือน), Plugin System (os-* packages), API ดีกว่า
  • pfSense: Community ใหญ่กว่ามาก, Documentation/Wiki ครบถ้วน, ZFS Support (Native), Stability ผ่านเวลานาน, Netgate Hardware Support
  • แนะนำ: เริ่มต้นใหม่ → OPNsense | มีทีม/Community pfSense อยู่แล้ว → pfSense

Hardware Requirements (Minimum)

  • CPU: x86_64 (Intel/AMD) - AES-NI สำคัญสำหรับ VPN/Encryption Performance
  • RAM: 2 GB ขั้นต่ำ (4-8 GB แนะนำสำหรับ Suricata/ClamAV/Proxy)
  • Storage: 8 GB (SSD/eMMC แนะนำ) - ZFS ต้องการ RAM มากกว่า
  • NIC: อย่างน้อย 2 Ports (WAN + LAN) - Intel i350/i210/i211 แนะนำ (Driver เสถียร)

Hardware Options สำหรับ Home Lab / SMB

  1. Repurpose Old PC: i5-6500T/7500T + Dual Intel NIC Card ($50-100)
  2. Mini PC: Protectli Vault (FW4B/FW6B), Qotom, MiniSys - Fanless, Low Power, 4-6 Ports ($150-300)
  3. Thin Client: Dell Wyse 5070, HP T640 - Add NIC via M.2/PCIe ($50-150)
  4. Netgate Appliances: 2100, 4100, 6100 - Official pfSense/Plus Hardware ($300-2000+)
  5. Raspberry Pi 4 + USB-Ethernet: ทดสอบได้ แต่ไม่แนะนำ Production (Single USB Bus Bottleneck)

ขั้นตอนติดตั้ง (OPNsense/pfSense)

  1. ดาวน์โหลด ISO (opnsense.org / pfsense.org)
  2. สร้าง Bootable USB (Rufus / BalenaEtcher / dd)
  3. Boot จาก USB > Install to Disk (SSD/eMMC)
  4. Console Setup: Assign Interfaces (WAN, LAN), Set LAN IP
  5. เข้าถึง Web GUI: https://LAN_IP (Default: root/opnsense หรือ admin/pfsense)
  6. Wizard: Timezone, DNS, WAN Type (DHCP/Static/PPPoE), LAN DHCP, Password
  7. Update Firmware > Install Plugins (os-* / Packages)

ฟีเจอร์หลักที่ได้ฟรี (Enterprise-grade)

  • Stateful Firewall + Aliases + Schedules
  • Multi-WAN / Failover / Load Balancing
  • VPN: IPsec, OpenVPN, WireGuard, Tailscale
  • IDS/IPS: Suricata (Inline / Legacy)
  • Web Proxy: Squid + ClamAV (AV Scanning)
  • DNS: Unbound (Resolver), DNS over TLS/HTTPS, Ad-blocking
  • DHCP/DHCPv6, DDNS, VLANs, CARP (HA)
  • Reporting/Graphing (RRD), NetFlow/sFlow Export
  • API (REST) + Automation (Ansible, Terraform)

สร้าง Firewall เองได้ไหม? (Custom Build)

ได้ ติดตั้ง Linux (Debian/Ubuntu/Rocky) + nftables/iptables + Suricata + Squid + Unbound + FRR + Docker Containers (CrowdSec, Wazuh, Pi-hole) ต้องมี Linux Sysadmin Skills สูง Maintain เองยากกว่า Appliance Distro

Legal: Firewall ถูกกฎหมายไหม?

ใช้ Firewall ปกป้อง Network ของตนเอง: ถูกกฎหมายทุกประเทศ ปัญหาเกิดเมื่อ: Block Traffic ผิดกฎหมาย (Censorship), Intercept TLS โดยไม่ได้รับสัตยาบัน, Violate Data Privacy Laws (PDPA/GDPR) Corporate Firewall ต้องมี Policy โปร่งใส พนักงานทราบ