hoatranlab.io.vn Zalo: 0917516878 Hotline: 0917516878 [email protected] LinkedIn
HoaTranLab Logo HoaTranLab
Trang chủ / Security / PAN-OS Lab 12 Tuần / Tuần 09
PAN-OS Administration Lab · Tuần 09/12

📘 Tuần 9 – High Availability (HA) và Virtual Systems (VSYS)

Trần Văn Hòa 2026 ~15 phút đọc Palo Alto · PAN-OS · PnetLab

📘 Tuần 9 – High Availability (HA) và Virtual Systems (VSYS)


🗺️ Sơ đồ – HA Active/Passive

graph TD Internet(["🌐 Internet"]) Switch_Core["🔀 Core Switch (hoặc Router ISP)"] subgraph HA_Cluster["🔥 HA Cluster – Palo Alto"] subgraph PA1["PA-LAB-01 (ACTIVE) 🟢"] PA1_E1["ethernet1/1 WAN 192.168.1.1"] PA1_E2["ethernet1/2 LAN VLAN10+20"] PA1_HA1["HA1 Port 10.0.0.1/30 (Control / Heartbeat)"] PA1_HA2["HA2 Port 10.0.0.5/30 (Data / Session Sync)"] end subgraph PA2["PA-LAB-02 (PASSIVE) 🔴"] PA2_E1["ethernet1/1 WAN (Standby)"] PA2_E2["ethernet1/2 LAN (Standby)"] PA2_HA1["HA1 Port 10.0.0.2/30"] PA2_HA2["HA2 Port 10.0.0.6/30"] end PA1_HA1 <-->|"Heartbeat + Config Sync Mỗi 1 giây"| PA2_HA1 PA1_HA2 <-->|"Session State Sync (Seamless failover)"| PA2_HA2 end Internet --> Switch_Core Switch_Core --> PA1_E1 Switch_Core -.->|"Khi PA1 fail (Failover < 30s)"| PA2_E1 style PA1 fill:#e8f5e9,stroke:#388e3c style PA2 fill:#ffebee,stroke:#c62828

📚 Lý thuyết cơ bản

🔰 HA là gì và tại sao cần?

High Availability (HA) = Cơ chế dự phòng – khi firewall chính hỏng, firewall dự phòng tự động tiếp quản mà không cần can thiệp thủ công.

💡 Tưởng tượng: Palo Alto như phi công chính và phi công phụ trên máy bay. - Phi công chính (Active) đang điều khiển. - Phi công phụ (Passive) luôn theo dõi và sẵn sàng tiếp quản bất cứ lúc nào. - Nếu phi công chính ngất → phi công phụ tiếp quản ngay lập tức.

🔰 Hai chế độ HA trong PAN-OS

Chế độMô tảFailover Time
Active/Passive1 thiết bị xử lý traffic, 1 thiết bị standby~30 giây
Active/ActiveCả 2 thiết bị xử lý traffic đồng thời~5 giây

🔰 Các kênh HA

KênhMục đíchInterface
HA1Heartbeat + đồng bộ cấu hình (Control Plane)Dedicated HA port hoặc Mgmt
HA2Đồng bộ session state (Data Plane)Dedicated HA port
HA3Packet forwarding (chỉ Active/Active)Optional

🔰 Virtual Systems (VSYS) là gì?

VSYS = Chia Palo Alto thành nhiều firewall logic độc lập (tương tự VDOM của FortiGate).

💡 Mỗi VSYS có: - Security Policy riêng. - Zone riêng. - NAT riêng. - Admin riêng (nếu muốn). Dùng trong: MSSP (quản lý nhiều khách hàng trên 1 thiết bị), tách môi trường Production/Dev/DMZ.


🛠️ Thực hành

Cấu hình HA – PA-LAB-01 (Active)

textadmin@PA-LAB-01> configure

# Cấu hình HA mode
admin@PA-LAB-01# set deviceconfig high-availability enabled yes
admin@PA-LAB-01# set deviceconfig high-availability group mode active-passive
admin@PA-LAB-01# set deviceconfig high-availability group description "HA-LAB-Cluster"

# Cấu hình HA1 (Control/Heartbeat)
admin@PA-LAB-01# set deviceconfig high-availability interface ha1 ip-address 10.0.0.1
admin@PA-LAB-01# set deviceconfig high-availability interface ha1 netmask 255.255.255.252
admin@PA-LAB-01# set deviceconfig high-availability interface ha1 gateway 10.0.0.2

# Cấu hình HA2 (Session Sync)
admin@PA-LAB-01# set deviceconfig high-availability interface ha2 ip-address 10.0.0.5
admin@PA-LAB-01# set deviceconfig high-availability interface ha2 netmask 255.255.255.252

# Đặt priority (số cao hơn = ưu tiên hơn, mặc định là 100)
admin@PA-LAB-01# set deviceconfig high-availability group active-passive priority 200
admin@PA-LAB-01# set deviceconfig high-availability group active-passive preemptive yes

# Peer IP address (IP HA1 của PA2)
admin@PA-LAB-01# set deviceconfig high-availability group peer-ip 10.0.0.2

admin@PA-LAB-01# commit

Cấu hình HA – PA-LAB-02 (Passive)

textadmin@PA-LAB-02> configure

admin@PA-LAB-02# set deviceconfig high-availability enabled yes
admin@PA-LAB-02# set deviceconfig high-availability group mode active-passive
admin@PA-LAB-02# set deviceconfig high-availability interface ha1 ip-address 10.0.0.2
admin@PA-LAB-02# set deviceconfig high-availability interface ha1 netmask 255.255.255.252
admin@PA-LAB-02# set deviceconfig high-availability interface ha1 gateway 10.0.0.1
admin@PA-LAB-02# set deviceconfig high-availability interface ha2 ip-address 10.0.0.6
admin@PA-LAB-02# set deviceconfig high-availability interface ha2 netmask 255.255.255.252
admin@PA-LAB-02# set deviceconfig high-availability group active-passive priority 100
admin@PA-LAB-02# set deviceconfig high-availability group peer-ip 10.0.0.1

admin@PA-LAB-02# commit

Kiểm tra HA

text# Xem trạng thái HA
admin@PA-LAB-01> show high-availability all
admin@PA-LAB-01> show high-availability state

# Xem đồng bộ cấu hình
admin@PA-LAB-01> show high-availability state-synchronization

# Forced failover (test)
admin@PA-LAB-01> request high-availability state suspend
# PA2 sẽ tự động trở thành Active

Tạo Virtual System (VSYS)

text# Bật VSYS mode (chỉ thiết bị phần cứng PA-3000+, PA-5000+)
# PA-VM trong lab có VSYS mặc định là vsys1
admin@PA-LAB-01# set vsys vsys2 display-name "GUEST-VSYS"

# Gán interface vào VSYS
admin@PA-LAB-01# set network interface ethernet ethernet1/3 vsys vsys2

admin@PA-LAB-01# commit

🔒 Bảo mật cần nhớ

  • ✅ Dùng dedicated HA interfaces riêng, không dùng Management interface cho HA.
  • ✅ Backup cấu hình trước khi thay đổi HA settings.
  • ✅ Test failover định kỳ theo lịch DR test (tối thiểu 3 tháng/lần).
  • ✅ Bật Preemptive để active node tự lấy lại quyền sau khi phục hồi.

📖 Case thực tế

Trung tâm dữ liệu thực hiện bảo trì thay RAM trên firewall chính. Nhờ HA Active/Passive: - Admin tắt PA-LAB-01 → PA-LAB-02 tự động Active trong 25 giây. - Toàn bộ session TCP tiếp tục không bị ngắt (Session Sync). - Bảo trì xong → PA-LAB-01 lên lại → tự động trở thành Active (Preemptive). 👉 HA đảm bảo zero downtime cho dịch vụ quan trọng.


📅 Tuần 9/12 – PAN-OS Administration Lab trên PnetLab