📘 Tuần 9 – High Availability (HA) và Virtual Systems (VSYS)
📘 Tuần 9 – High Availability (HA) và Virtual Systems (VSYS)
🗺️ Sơ đồ – HA Active/Passive
📚 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/Passive | 1 thiết bị xử lý traffic, 1 thiết bị standby | ~30 giây |
| Active/Active | Cả 2 thiết bị xử lý traffic đồng thời | ~5 giây |
🔰 Các kênh HA
| Kênh | Mục đích | Interface |
|---|---|---|
| HA1 | Heartbeat + đồng bộ cấu hình (Control Plane) | Dedicated HA port hoặc Mgmt |
| HA2 | Đồng bộ session state (Data Plane) | Dedicated HA port |
| HA3 | Packet 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