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

📘 Tuần 4 – Zones, Interfaces và Định tuyến cơ bản

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

📘 Tuần 4 – Zones, Interfaces và Định tuyến cơ bản


🗺️ Sơ đồ – Zones và Interfaces

graph TD Internet(["🌐 Internet"]) subgraph PAN["🔥 Palo Alto PA-LAB-01"] subgraph Untrust["🔴 Zone: Untrust (Không tin tưởng)"] E1["ethernet1/1 IP: DHCP từ Cloud0 Loại: Layer3"] end subgraph Trust["🟢 Zone: Trust (Tin tưởng - Nội bộ)"] E2_10["ethernet1/2.10 Sub-interface VLAN10 10.10.10.1/24"] E2_20["ethernet1/2.20 Sub-interface VLAN20 10.10.20.1/24"] end subgraph DMZ_zone["🟡 Zone: DMZ (Vùng trung lập)"] E3["ethernet1/3 10.10.30.1/24 Web server public"] end VR["📍 Virtual Router: default Default Route: 0.0.0.0/0 → Next-hop: GW của ISP"] end subgraph SW["🔀 Cisco Switch"] trunk["e0/0 Trunk VLAN10+20"] vlan10["e0/1 VLAN10"] vlan20["e0/2 VLAN20"] end PC["💻 PC-Client 10.10.10.100 GW: 10.10.10.1"] SRV["🖥️ Server 10.10.20.100 GW: 10.10.20.1"] Internet --> E1 E2_10 --> trunk --> vlan10 --> PC trunk --> vlan20 --> SRV E2_20 --> trunk style Untrust fill:#ffebee,stroke:#f44336 style Trust fill:#e8f5e9,stroke:#4caf50 style DMZ_zone fill:#fff9c4,stroke:#fbc02d

📚 Lý thuyết cơ bản

🔰 Zone là gì? (Khái niệm ĐẶC TRƯNG của Palo Alto)

Zone = Vùng mạng logic – là trái tim của Palo Alto Firewall.

💡 Hãy tưởng tượng một tòa nhà: - Untrust Zone = Vỉa hè bên ngoài (ai cũng vào được, không tin ai). - Trust Zone = Khu văn phòng nhân viên (chỉ nhân viên vào). - DMZ Zone = Sảnh tiếp khách (khách được vào, nhưng có giám sát). Traffic đi giữa các zone → BẮT BUỘC phải có Security Policy cho phép! Traffic trong cùng một zone → mặc định được phép (Intrazone-default = allow).

🔰 Các loại Interface trong PAN-OS

LoạiGiải thíchDùng khi
Layer 3Interface có địa chỉ IP, định tuyếnThông thường nhất
Layer 2Interface không có IP, chuyển mạchSwitch mode
Virtual Wire"Trong suốt" – không thay đổi topologyIDS/IPS inline
TapChỉ nhận bản sao traffic để phân tíchMonitor/Analyze
Sub-interfaceInterface ảo trên physical interface, dùng VLAN tagVLAN routing
LoopbackInterface ảo nội bộDNS sinkhole, BGP

🔰 Virtual Router là gì?

Virtual Router = Bảng định tuyến trong Palo Alto.

💡 Mỗi Palo Alto có thể có nhiều Virtual Router độc lập (như VDOM của FortiGate). Mặc định có 1 VR tên là default.

🔰 So sánh Zone Palo Alto vs Interface FortiGate

Palo AltoFortiGate
Đơn vị kiểm soátZoneInterface trực tiếp
Policy dựa vàoSource Zone → Dest ZoneSource Interface → Dest Interface
Intra-zone trafficMặc định AllowCần policy riêng
Inter-zone trafficMặc định DenyMặc định Deny

🛠️ Thực hành

Bước 1: Tạo Zones

textadmin@PA-LAB-01> configure

# Tạo zone Untrust (WAN)
admin@PA-LAB-01# set zone Untrust network layer3

# Tạo zone Trust (LAN)
admin@PA-LAB-01# set zone Trust network layer3

# Tạo zone DMZ
admin@PA-LAB-01# set zone DMZ network layer3

Bước 2: Cấu hình Interface Layer3

text# Interface WAN (ethernet1/1) - gán vào zone Untrust
admin@PA-LAB-01# set network interface ethernet ethernet1/1 layer3 ip 0.0.0.0/0
admin@PA-LAB-01# set network interface ethernet ethernet1/1 layer3 dhcp client enable yes
admin@PA-LAB-01# set zone Untrust network layer3 member ethernet1/1

# Interface LAN (ethernet1/2) - Trunk, không gán IP trực tiếp
admin@PA-LAB-01# set network interface ethernet ethernet1/2 layer3

Bước 3: Tạo Sub-interface VLAN

text# Sub-interface VLAN10 (Client)
admin@PA-LAB-01# set network interface ethernet ethernet1/2 layer3 units ethernet1/2.10 vlan-id 10
admin@PA-LAB-01# set network interface ethernet ethernet1/2 layer3 units ethernet1/2.10 ip 10.10.10.1/24
admin@PA-LAB-01# set zone Trust network layer3 member ethernet1/2.10

# Sub-interface VLAN20 (Server)
admin@PA-LAB-01# set network interface ethernet ethernet1/2 layer3 units ethernet1/2.20 vlan-id 20
admin@PA-LAB-01# set network interface ethernet ethernet1/2 layer3 units ethernet1/2.20 ip 10.10.20.1/24
admin@PA-LAB-01# set zone Trust network layer3 member ethernet1/2.20

Bước 4: Tạo Static Route

text# Default route ra Internet
admin@PA-LAB-01# set network virtual-router default routing-table ip static-route "Default-Route" interface ethernet1/1 nexthop ip-address 192.168.1.254
admin@PA-LAB-01# set network virtual-router default routing-table ip static-route "Default-Route" destination 0.0.0.0/0

admin@PA-LAB-01# commit

Kiểm tra kết quả

text# Xem zones
admin@PA-LAB-01> show zone

# Xem interfaces
admin@PA-LAB-01> show interface all

# Xem routing table
admin@PA-LAB-01> show routing route

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

  • ✅ Luôn gán interface vào đúng Zone trước khi dùng trong policy.
  • ✅ Zone Untrust = WAN, không tin tưởng bất kỳ traffic nào.
  • ✅ Không bao giờ gán Management interface vào Data Zone.

📖 Case thực tế

Kỹ thuật viên tạo Security Policy nhưng traffic vẫn bị chặn. Kiểm tra lại phát hiện sub-interface VLAN10 chưa được gán vào Zone Trust → policy có Source Zone = Trust nhưng interface không thuộc Trust → không match! 👉 Bài học: Luôn kiểm tra Zone assignment sau khi tạo interface.


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