Palo Alto Firewall Configuration Document
WAN DHCP + Cisco Layer 2 Switch + 5 VLANs + Separate Security Zones
ประเภทเอกสาร: Network Configuration & Implementation Guide
อุปกรณ์: Palo Alto Next-Generation Firewall
ระบบปฏิบัติการ: PAN-OS
Switch: Cisco Layer 2
WAN Connection: DHCP Client
จำนวน VLAN: 5 VLANs
Security Zone: Separate Zones
1. วัตถุประสงค์ (Objective)
เอกสารฉบับนี้จัดทำขึ้นเพื่อกำหนดแนวทางการ Configuration Palo Alto Firewall โดยเชื่อมต่อกับ Cisco Layer 2 Switch ผ่าน Interface ethernet1/2 และแบ่งเครือข่ายออกเป็น 5 VLAN ผ่าน Subinterface
Palo Alto Firewall ทำหน้าที่เป็น Default Gateway ของแต่ละ VLAN พร้อมควบคุมการรับส่งข้อมูลด้วย Security Policy และทำ Source NAT เพื่อให้ Client ภายในสามารถเชื่อมต่อ Internet ผ่าน WAN Interface ที่ได้รับ IP Address แบบ DHCP
วัตถุประสงค์หลัก
- แบ่ง Network ออกเป็น 5 VLAN
- กำหนด Subinterface บน Palo Alto Firewall
- แยก Security Zone ตาม VLAN
- กำหนด Security Policy สำหรับ Internet Access
- กำหนด NAT Policy สำหรับแปลง Private IP เป็น WAN IP
- กำหนด Routing เพื่อให้สามารถออก Internet ได้
- ตรวจสอบ Traffic Log และผลการเชื่อมต่อ
2. Network Topology
Network Diagram
INTERNET / ISP
↓
Palo Alto Firewall
- ethernet1/1 = WAN DHCP
- ethernet1/2 = LAN Trunk
- ethernet1/2.10 = VLAN 10
- ethernet1/2.20 = VLAN 20
- ethernet1/2.30 = VLAN 30
- ethernet1/2.40 = VLAN 40
- ethernet1/2.50 = VLAN 50
↓ 802.1Q Trunk
Cisco Layer 2 Switch
↓
Client Devices แบ่งตาม VLAN 10, 20, 30, 40 และ 50
3. IP Address Design
กำหนด IP Address สำหรับแต่ละ VLAN ดังนี้
| VLAN | Subinterface | Network | Gateway | Security Zone |
|---|---|---|---|---|
| 10 | e1/2.10 | 192.168.10.0/24 | 192.168.10.1 | ZONE-VLAN10 |
| 20 | e1/2.20 | 192.168.20.0/24 | 192.168.20.1 | ZONE-VLAN20 |
| 30 | e1/2.30 | 192.168.30.0/24 | 192.168.30.1 | ZONE-VLAN30 |
| 40 | e1/2.40 | 192.168.40.0/24 | 192.168.40.1 | ZONE-VLAN40 |
| 50 | e1/2.50 | 192.168.50.0/24 | 192.168.50.1 | ZONE-VLAN50 |
WAN Interface:
- Interface: ethernet1/1
- Interface Type: Layer3
- IPv4: DHCP Client
- Security Zone: Untrust
- Virtual Router: default
4. Configure WAN Interface (DHCP)
เข้า Palo Alto Web GUI
Menu: Network → Interfaces → Ethernet → ethernet1/1
กำหนดค่าดังนี้
| Parameter | Configuration |
|---|---|
| Interface | ethernet1/1 |
| Interface Type | Layer3 |
| Virtual Router | default |
| Security Zone | Untrust |
| IPv4 Type | DHCP Client |
| Automatically Create Default Route | Enable |
| Default Route Metric | 10 |
ตรวจสอบว่า WAN ได้รับข้อมูลจาก ISP ดังนี้
- IP Address
- Subnet Mask
- Default Gateway
- DNS (ถ้ามีการแจกผ่าน DHCP)
หมายเหตุ: เปิด Automatically create default route pointing to default gateway provided by server เพื่อให้ Firewall รับ Default Route จาก DHCP Server ของ ISP
5. Configure LAN Physical Interface
เข้าเมนู:
Network → Interfaces → Ethernet → ethernet1/2
กำหนดค่า:
| Parameter | Configuration |
|---|---|
| Interface | ethernet1/2 |
| Interface Type | Layer3 |
| Virtual Router | default |
| Security Zone | None |
| IPv4 Address | ไม่กำหนด |
Interface ethernet1/2 จะทำหน้าที่เป็น Parent Interface สำหรับ Subinterface ทั้ง 5 VLAN
6. Configure Subinterface
เข้าเมนู:
Network → Interfaces → Ethernet
เลือก ethernet1/2 และสร้าง Subinterface จำนวน 5 รายการ
| Interface | VLAN Tag | IPv4 Address | Security Zone |
|---|---|---|---|
| ethernet1/2.10 | 10 | 192.168.10.1/24 | ZONE-VLAN10 |
| ethernet1/2.20 | 20 | 192.168.20.1/24 | ZONE-VLAN20 |
| ethernet1/2.30 | 30 | 192.168.30.1/24 | ZONE-VLAN30 |
| ethernet1/2.40 | 40 | 192.168.40.1/24 | ZONE-VLAN40 |
| ethernet1/2.50 | 50 | 192.168.50.1/24 | ZONE-VLAN50 |
กำหนดค่าของแต่ละ Subinterface:
- Interface Type: Layer3
- Tag: กำหนดตาม VLAN
- Virtual Router: default
- Security Zone: กำหนดแยกตาม VLAN
- IPv4 Address: Static
ตัวอย่าง VLAN 10:
Interface: ethernet1/2.10
Tag: 10
Virtual Router: default
Security Zone: ZONE-VLAN10
IPv4 Address: 192.168.10.1/24
ดำเนินการเช่นเดียวกันสำหรับ VLAN ที่เหลือ
7. Configure Security Zones
เข้าเมนู:
Network → Zones → Add
สร้าง Security Zone ดังนี้
| Zone Name | Zone Type | Interface |
|---|---|---|
| ZONE-VLAN10 | Layer3 | ethernet1/2.10 |
| ZONE-VLAN20 | Layer3 | ethernet1/2.20 |
| ZONE-VLAN30 | Layer3 | ethernet1/2.30 |
| ZONE-VLAN40 | Layer3 | ethernet1/2.40 |
| ZONE-VLAN50 | Layer3 | ethernet1/2.50 |
| Untrust | Layer3 | ethernet1/1 |
การแยก Security Zone จะช่วยให้สามารถกำหนด Security Policy และควบคุมการรับส่งข้อมูลของแต่ละ VLAN ได้อย่างอิสระ
8. Configure Cisco Layer 2 Switch
กำหนด Cisco Switch ให้รองรับ VLAN 10, 20, 30, 40 และ 50
สมมติการเชื่อมต่อ:
- Gi1/0/24 = Uplink ไป Palo Alto ethernet1/2
- Gi1/0/1 = Client VLAN10
- Gi1/0/2 = Client VLAN20
- Gi1/0/3 = Client VLAN30
- Gi1/0/4 = Client VLAN40
- Gi1/0/5 = Client VLAN50
Cisco Switch Configuration
configure terminal
vlan 10
name VLAN10
vlan 20
name VLAN20
vlan 30
name VLAN30
vlan 40
name VLAN40
vlan 50
name VLAN50
interface GigabitEthernet1/0/24
description UPLINK-TO-PALOALTO-E1/2
switchport mode trunk
switchport trunk allowed vlan 10,20,30,40,50
no shutdown
exit
interface GigabitEthernet1/0/1
description CLIENT-VLAN10
switchport mode access
switchport access vlan 10
spanning-tree portfast
no shutdown
exit
interface GigabitEthernet1/0/2
description CLIENT-VLAN20
switchport mode access
switchport access vlan 20
spanning-tree portfast
no shutdown
exit
interface GigabitEthernet1/0/3
description CLIENT-VLAN30
switchport mode access
switchport access vlan 30
spanning-tree portfast
no shutdown
exit
interface GigabitEthernet1/0/4
description CLIENT-VLAN40
switchport mode access
switchport access vlan 40
spanning-tree portfast
no shutdown
exit
interface GigabitEthernet1/0/5
description CLIENT-VLAN50
switchport mode access
switchport access vlan 50
spanning-tree portfast
no shutdown
exit
end
write memory
ตรวจสอบ Cisco Switch
show vlan brief
show interfaces trunk
show interfaces status
หมายเหตุ: คำสั่งอาจแตกต่างกันตามรุ่น Cisco Switch และ IOS ที่ใช้งาน
9. Configure Security Policy
เข้าเมนู:
Policies → Security → Add
สร้าง Policy Name:
ALLOW-ALL-VLAN-TO-INTERNET
กำหนดค่าดังนี้
General
- Name: ALLOW-ALL-VLAN-TO-INTERNET
- Rule Type: universal
Source
- Source Zone:
- ZONE-VLAN10
- ZONE-VLAN20
- ZONE-VLAN30
- ZONE-VLAN40
- ZONE-VLAN50
- Source Address: กำหนด Network ทั้ง 5 VLAN
Destination
- Destination Zone: Untrust
- Destination Address: any
Application
- Application: any
- Service: application-default
Actions
- Action: Allow
- Log at Session End: Enable
Source Network:
- 192.168.10.0/24
- 192.168.20.0/24
- 192.168.30.0/24
- 192.168.40.0/24
- 192.168.50.0/24
หมายเหตุ: Policy นี้อนุญาตทุก Application จาก VLAN ที่ระบุไปยัง Untrust หากต้องการจำกัด Application ให้กำหนด Application ที่อนุญาต เช่น ping, web-browsing และ ssl
ควรตรวจสอบลำดับ Security Policy และ Rule ที่มีอยู่ก่อนสร้าง Policy ใหม่
10. Configure NAT Policy
เข้าเมนู:
Policies → NAT → Add
สร้าง NAT Policy Name:
NAT-ALL-VLAN-TO-INTERNET
Original Packet
| Parameter | Configuration |
|---|---|
| Source Zone | ZONE-VLAN10, 20, 30, 40, 50 |
| Destination Zone | Untrust |
| Destination Interface | any |
| Source Address | 5 VLAN Subnets |
| Destination Address | any |
| Service | any |
Translated Packet
| Parameter | Configuration |
|---|---|
| Source Translation | Dynamic IP and Port |
| Address Type | Interface Address |
| Interface | ethernet1/1 |
| IP Address | DHCP-assigned WAN IP |
NAT จะทำหน้าที่แปลง Source IP จาก Private Network ให้เป็น IP Address ของ WAN Interface เพื่อให้ Client สามารถเชื่อมต่อ Internet ได้
หมายเหตุ:
- WAN Interface ต้องได้รับ DHCP Address ก่อน
- เลือก ethernet1/1 ใน Interface Address
- ไม่จำเป็นต้องกำหนด Public IP แบบ Static
- ตรวจสอบลำดับ NAT Rule เพื่อไม่ให้ชนกับ Rule อื่น
11. Configure Routing
เข้าเมนู:
Network → Virtual Routers → default → Static Routes
ตรวจสอบ WAN Interface ethernet1/1 ว่ากำหนด DHCP Client และเปิดตัวเลือก Automatically create default route pointing to default gateway provided by server
Routing Table ที่คาดหวัง:
| Destination | Next Hop | Interface |
|---|---|---|
| 192.168.10.0/24 | Connected | e1/2.10 |
| 192.168.20.0/24 | Connected | e1/2.20 |
| 192.168.30.0/24 | Connected | e1/2.30 |
| 192.168.40.0/24 | Connected | e1/2.40 |
| 192.168.50.0/24 | Connected | e1/2.50 |
| 0.0.0.0/0 | DHCP Gateway | e1/1 |
หมายเหตุ: Subinterface จะสร้าง Connected Route โดยอัตโนมัติเมื่อกำหนด IP Address และทำงานอยู่ ส่วน Default Route จะเรียนรู้จาก DHCP WAN
ไม่ควรสร้าง Default Route ซ้ำ หาก DHCP ได้สร้าง Default Route ให้อยู่แล้ว
12. Configure DHCP Server (Optional)
หากต้องการให้ Palo Alto เป็น DHCP Server สำหรับ Client แต่ละ VLAN สามารถตั้งค่าได้ที่:
Network → DHCP → DHCP Server → Add
ตัวอย่าง DHCP Pool:
| VLAN | DHCP Pool | Default Gateway |
|---|---|---|
| 10 | 192.168.10.10–192.168.10.200 | 192.168.10.1 |
| 20 | 192.168.20.10–192.168.20.200 | 192.168.20.1 |
| 30 | 192.168.30.10–192.168.30.200 | 192.168.30.1 |
| 40 | 192.168.40.10–192.168.40.200 | 192.168.40.1 |
| 50 | 192.168.50.10–192.168.50.200 | 192.168.50.1 |
DNS Server ตัวอย่าง:
- 1.1.1.1
- 8.8.8.8
หากมี DHCP Server ภายนอกอยู่แล้ว ไม่จำเป็นต้องเปิด DHCP Server บน Palo Alto
13. Commit Configuration
ก่อน Commit ให้ตรวจสอบรายการต่อไปนี้
- WAN ethernet1/1 ได้รับ DHCP IP
- WAN ได้รับ Default Gateway
- ethernet1/2 กำหนดเป็น Layer3
- สร้าง Subinterface ครบ 5 VLAN
- กำหนด VLAN Tag ถูกต้อง
- สร้าง Security Zone ครบ 5 Zone
- Cisco Switch Uplink เป็น Trunk
- กำหนด Security Policy แล้ว
- กำหนด NAT Policy แล้ว
- ตรวจสอบ Routing แล้ว
- ตรวจสอบ Configuration ไม่มี Error
จากนั้นดำเนินการ:
- คลิก Commit
- เลือก Commit All Changes ตามสิทธิ์และรูปแบบการจัดการ Configuration
- รอจน Commit สำเร็จ
- ตรวจสอบ Interface และ Routing Table อีกครั้ง
14. Testing & Verification
14.1 ตรวจสอบ Client IP Address
| VLAN | Client IP | Gateway |
|---|---|---|
| 10 | 192.168.10.10 | 192.168.10.1 |
| 20 | 192.168.20.10 | 192.168.20.1 |
| 30 | 192.168.30.10 | 192.168.30.1 |
| 40 | 192.168.40.10 | 192.168.40.1 |
| 50 | 192.168.50.10 | 192.168.50.1 |
14.2 ทดสอบ Ping Gateway
จาก Client แต่ละ VLAN:
ping 192.168.10.1
ping 192.168.20.1
ping 192.168.30.1
ping 192.168.40.1
ping 192.168.50.1
ให้ทดสอบเฉพาะ Gateway ของ VLAN ที่ Client เชื่อมต่ออยู่
14.3 ทดสอบ Internet
ping 1.1.1.1
ทดสอบ HTTPS และ DNS เพิ่มเติม เพื่อยืนยันการใช้งาน Internet
14.4 ตรวจสอบ Traffic Log
เข้าเมนู:
Monitor → Logs → Traffic
Filter VLAN 10:
(addr.src in 192.168.10.10)
Filter VLAN 20:
(addr.src in 192.168.20.10)
Filter Traffic ที่ Allow ออก Internet:
(zone.dst eq Untrust) and (action eq allow)
ตรวจสอบ Field ดังนี้:
| Field | Expected |
|---|---|
| Source | Client IP |
| Destination Zone | Untrust |
| Application | ping / web-browsing / ssl |
| Action | allow |
| NAT Source | WAN Interface IP |
15. Test Acceptance Criteria
| Test Item | Expected Result |
|---|---|
| VLAN 10 Gateway | PASS |
| VLAN 20 Gateway | PASS |
| VLAN 30 Gateway | PASS |
| VLAN 40 Gateway | PASS |
| VLAN 50 Gateway | PASS |
| VLAN 10 Internet | PASS |
| VLAN 20 Internet | PASS |
| VLAN 30 Internet | PASS |
| VLAN 40 Internet | PASS |
| VLAN 50 Internet | PASS |
| Security Policy | Allow |
| Source NAT | Correct |
| Default Routing | Active |
| VLAN-to-VLAN | Deny หากไม่มี Policy อนุญาต |
16. Troubleshooting
กรณี Client Ping Gateway ไม่ได้
- ตรวจสอบ VLAN Access Port บน Cisco Switch
- ตรวจสอบ Trunk Port
- ตรวจสอบ VLAN Tag
- ตรวจสอบ Subinterface และ IP Address
กรณี Ping Gateway ได้ แต่ Internet ไม่ได้
- ตรวจสอบ WAN DHCP
- ตรวจสอบ Default Route
- ตรวจสอบ Security Policy
- ตรวจสอบ NAT Policy
- ตรวจสอบ DNS
กรณี Traffic Log เป็น Deny
- ตรวจสอบ Source Zone
- ตรวจสอบ Destination Zone
- ตรวจสอบ Security Policy Rule Order
- ตรวจสอบ Application และ Service
กรณี NAT ไม่ทำงาน
- ตรวจสอบ Original Source Zone
- ตรวจสอบ Destination Zone
- ตรวจสอบ Source Address
- ตรวจสอบ Translated Packet
- ตรวจสอบ WAN Interface Address
17. Final Configuration Summary
| Component | Configuration |
|---|---|
| WAN Interface | ethernet1/1 DHCP |
| LAN Interface | ethernet1/2 Layer3 |
| Switch | Cisco Layer 2 |
| Uplink | 802.1Q Trunk |
| VLAN Count | 5 |
| Subinterface | ethernet1/2.10–50 |
| Security Zones | 5 Separate Zones |
| Virtual Router | default |
| Security Policy | VLAN to Untrust Allow |
| NAT Policy | Dynamic IP and Port |
| NAT Interface | ethernet1/1 |
| Routing | DHCP Default Route |
| DHCP Server | Optional |
Network Traffic Flow
Client VLAN → Cisco Layer 2 Switch → Palo Alto Subinterface → Security Policy → Source NAT → WAN Interface → Internet
18. Conclusion
การ Configuration นี้เป็นการออกแบบระบบ Network โดยใช้ Palo Alto Firewall เป็นศูนย์กลางในการควบคุมและรักษาความปลอดภัยของเครือข่าย แบ่ง Network ออกเป็น 5 VLAN และกำหนด Security Zone แยกจากกัน เพื่อให้สามารถควบคุมการรับส่งข้อมูลได้อย่างเป็นอิสระ
ระบบสามารถรองรับการเชื่อมต่อ Internet ผ่าน WAN DHCP โดยใช้ Dynamic IP and Port NAT และกำหนด Default Route จาก DHCP Gateway ของ ISP
เมื่อ Configuration และ Testing สำเร็จ Client ในแต่ละ VLAN จะสามารถเชื่อมต่อ Internet ได้ตาม Security Policy ที่กำหนด
หมายเหตุ: ค่า IP Address และ Interface ในเอกสารนี้เป็นตัวอย่างสำหรับการออกแบบ ต้องตรวจสอบกับระบบจริงก่อนนำไปใช้งาน และควรสำรอง Configuration ก่อนดำเนินการเปลี่ยนแปลง
Document Status: Draft
Prepared For: Network Implementation
Configuration Platform: Palo Alto PAN-OS / Cisco Layer 2
End of Document