ASA上的NAT类型
动态NAT
动态PAT
静态NAT
静态PAT
动态NAT
配置步骤:
1)指定需要进行地址转换的网段
asa(config)# nat (inside) 1 10.1.1.0 255.255.255.0
2)定义全局地址池
asa(config)# global (outside/dmz) 1 172.16.1.100-172.16.1.200
使用 show xlate detail命令查看NAT转换表:
asa# show xlate detail
1 in use. 1 most
Flags: D-DNS, d-dump, I-identity, i-dynamic, n-no random
r- portmap, s-static
NAT from inside: 10.1.1.1 to outside: 172.16.1.100 flags
PC2可以访问PC4 但是没有进行地址转化
动态PAT
配置命令:
asa(config)# nat (inside) 1 10.1.1.0 255.255.255.0
asa(config)# global (outside) 1 172.16.1.200
直接使用outside接口的IP地址进行转换的配置命令:
asa(config)# nat (inside) 1 10.1.1.0 255.255.255.0
asa(config)# global (outside) 1 interface
使用show xlate detail命令查看xlatet表:
asa# show xlate detail
1 in use, 1 most used
Flags: D - DNS, d- dump, I identity,t-dynamic, n - no random,
r portmap, s - static
TCP PAT from inside:10.1.1.112989 to outside:172.16.1.2001024 flags ri
静态NAT
PC3默认可以访问PC4,而PC4要访问PC3,需要配置ACL:
asa(config)# access-list out_to_dmz permit ip host 172.16.1.1host 192.168.1.1
asa(config)# access-group out to_ dmz in int outside
PC3和PC4之间互相访问都是使用自身的IP地址
配置静态NAT,将192.168.1.1/24映射为172.16.1.201/24 ,可以隐藏PC3的IP地址
静态NAT创建了一个从真实地址到映射地址的一对一的固定转换,可用于双向通信
静态NAT的命令语法:
asa(config)# static (local if name,global if name) global-iplocal-ip [netmask mask]
配置静态NAT:
asa(config)# static (dmz,outside) 172.16.1.201 192.168.1.1
配置ACL