Thực hiện Static PAT và Identity NAT

I. Mô tả:
Cho phép người dùng bên ngoài truy cập dịch vụ Web và Remote Desktop với PAT tĩnh (Static PAT) trong vùng DMZ.
Cho phép người dùng trong vùng INSIDE truy cập dịch vụ Web, FTP trong vùng DMZ mà không cần thực hiện NAT hoặc PAT
II. Cấu hình
Thực hiện Nat tĩnh 
ASA(config)# static (DMZ,outside) tcp 195.1.1.10 80 192.168.2.2 80
ASA(config)# static (DMZ,outside) tcp 195.1.1.10 3389 192.168.2.2 3389

Định nghĩa chính sách cho phép truy cập dịch vụ trong DMZ
ASA(config)# access-list POLICY permit tcp any host 195.1.1.10 eq 80
ASA(config)# access-list POLICY permit tcp any host 195.1.1.10 eq 3389
ASA(config)# access-group POLICY in interface outside

Định nghĩa luồng dữ liệu không thực hiện NAT
ASA(config)# access-list ACCESS_DMZ permit ip 192.168.1.0 255.255.255.0 host 192.168.2.2
ASA(config)# nat (inside) 0 access-list ACCESS_DMZ

III. Cấu hình đầy đủ
ASA
ASA Version 8.0(2)
!
hostname ASA
enable password 8Ry2YjIyt7RRXU24 encrypted
names
!
interface Ethernet0/0
nameif inside
security-level 100
ip address 192.168.1.1 255.255.255.0
!
interface Ethernet0/1
nameif DMZ
security-level 50
ip address 192.168.2.1 255.255.255.0
!
interface Ethernet0/2
nameif outside
security-level 0
ip address 195.1.1.1 255.255.255.0
!
interface Ethernet0/3
shutdown
no nameif
no security-level
no ip address
!
interface Management0/0
shutdown
no nameif
no security-level
no ip address
management-only
!
passwd 2KFQnbNIdI.2KYOU encrypted
ftp mode passive

access-list POLICY extended permit tcp any host 195.1.1.10 eq 3389
access-list POLICY extended permit tcp any host 195.1.1.10 eq www
access-list ACCESS_DMZ extended permit ip 192.168.1.0 255.255.255.0 host 192.168.2.2
static (DMZ,outside) tcp 195.1.1.10 3389 192.168.2.2 3389 netmask 255.255.255.255
static (DMZ,outside) tcp 195.1.1.10 www 192.168.2.2 www netmask 255.255.255.255
access-group POLICY in interface outside
route outside 0.0.0.0 0.0.0.0 195.1.1.2 1

!
class-map inspection_default
match default-inspection-traffic
!
!
policy-map type inspect dns preset_dns_map
parameters
message-length maximum 512
policy-map global_policy
class inspection_default
inspect dns preset_dns_map
inspect ftp
inspect h323 h225
inspect h323 ras
inspect rsh
inspect rtsp
inspect esmtp
inspect sqlnet
inspect skinny
inspect sunrpc
inspect xdmcp
inspect sip
inspect netbios
inspect tftp
!
service-policy global_policy global
prompt hostname context
Cryptochecksum:78cf59a0893129f9c01ea495adb5cb53
: end

IV. Kiểm tra
ASA(config)# sh xlate
2 in use, 2 most used
PAT Global 195.1.1.10(3389) Local 192.168.2.2(3389) 
PAT Global 195.1.1.10(80) Local 192.168.2.2(80) 

Thực hiện truy cập dịch vụ Web trong DMZ từ outside


Thực hiện truy cập dịch vụ Remote Desktop trong DMZ từ outside




ASA(config)# sh conn
2 in use, 2 most used
TCP out 150.1.1.1:1157 in 192.168.2.2:80 idle 0:00:04 bytes 1055 flags UIOB
TCP out 150.1.1.1:1156 in 192.168.2.2:3389 idle 0:00:01 bytes 29396 flags UIOB

Truy cập dịch vụ Web trong DMZ từ inside







Truy cập dịch vụ FTP trong DMZ từ inside



ASA(config)# sh conn
3 in use, 4 most used
TCP out 150.1.1.1:1156 in 192.168.2.2:3389 idle 0:02:40 bytes 29922 flags UIOB
TCP out 192.168.2.2:80 in 192.168.1.2:1181 idle 0:00:04 bytes 9531 flags UIO
TCP out 192.168.2.2:21 in 192.168.1.2:1178 idle 0:01:38 bytes 276 flags UIO