📘 Tuần 4 – Zones, Interfaces và Định tuyến cơ bản
📘 Tuần 4 – Zones, Interfaces và Định tuyến cơ bản
🗺️ Sơ đồ – Zones và Interfaces
📚 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ại | Giải thích | Dùng khi |
|---|---|---|
| Layer 3 | Interface có địa chỉ IP, định tuyến | Thông thường nhất |
| Layer 2 | Interface không có IP, chuyển mạch | Switch mode |
| Virtual Wire | "Trong suốt" – không thay đổi topology | IDS/IPS inline |
| Tap | Chỉ nhận bản sao traffic để phân tích | Monitor/Analyze |
| Sub-interface | Interface ảo trên physical interface, dùng VLAN tag | VLAN routing |
| Loopback | Interface ả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 Alto | FortiGate | |
|---|---|---|
| Đơn vị kiểm soát | Zone | Interface trực tiếp |
| Policy dựa vào | Source Zone → Dest Zone | Source Interface → Dest Interface |
| Intra-zone traffic | Mặc định Allow | Cần policy riêng |
| Inter-zone traffic | Mặc định Deny | Mặ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