Paloalto U-Turn NAT

Nattapong Thitichawalitkul
2 min readApr 18, 2021

--

Network Diagram

โดยปกติแล้ว เราจะให้ Client เข้าไปยัง Server ด้วย IP 10.1.2.200 ตรงๆ แต่ก็จะมีบางกรณีเช่นกันที่ Admin ต้องการให้ Client เข้าไปยัง Server ด้วย Public IP (ในตัวอย่าง คือ 192.168.1.139) ส่วนใหญ่จะเจอในกรณีที่มีการ Map FQDN Domain Name บน Public DNS Server โดยตัว Paloalto Firewall จะเรียกการทำ NAT ในกรณีนี้ว่า U-Turn NAT

Network Diagram with U-Turn NAT

ตัวอย่างการ Config บน Paloalto Firewall

NAT Policy — สังเกตที่ Zone จะเขียนจาก Trusted ไปยัง Untrusted โดย Destination จะเป็น Pre-NAT IP (อ้อมไปทาง Untrusted Zone ก่อนค่อยลงไปที่ Server Zone ตรงนี้ที่เรียกว่า U-Turn)
Security Policy — ในการเขียน Policy จะใช้ Source Zone จาก Trusted ไปยัง Server

ในการเขียน Security Policy จะอ้างอิงหลังจากที่มีการทำ Route Lookup บน Post NAT แล้ว นั่นคือ Server Zone นั่นเอง

Security Logs

The most common mistakes when configuring NAT and security rules are the references to the zones and address objects. The addresses used in destination NAT rules always refer to the original IP address in the packet (that is, the pre-translated address). The destination zone in the NAT rule is determined after the route lookup of the destination IP address in the original packet (that is, the pre-NAT destination IP address).

The addresses in the security policy also refer to the IP address in the original packet (that is, the pre-NAT address). However, the destination zone is the zone where the end host is physically connected. In other words, the destination zone in the security rule is determined after the route lookup of the post-NAT destination IP address.

--

--

Nattapong Thitichawalitkul
Nattapong Thitichawalitkul

No responses yet