需求:

掌握防火墙NAT配置


实验拓扑图如下

ASA思科防火墙NAT配置_内网


IP地址规划

IOU1

loo0:218.85.152.99

e0/0:200.1.1.1

IOU2

loo0:192.168.1.11

e0/0:192.168.0.1

IOU3

loo0:172.16.88.11

e0/0:172.16.1.1

ASA-1

g 0:200.1.1.254

g 1:192.168.0.254

g 2:172.16.1.254


一、配置接口地址

IOU1配置

IOU1#conf t
IOU1(config)#int loo0
IOU1(config-if)#ip add 218.85.152.99 255.255.255.0
IOU1(config-if)#ex
IOU1(config)#int e0/0
IOU1(config-if)#du fu
IOU1(config-if)#ip add 200.1.1.1 255.255.255.0
IOU1(config-if)#no shut
IOU1(config-if)#ex
IOU1(config)#

IOU2配置

IOU2#conf t
IOU2(config)#int loo0
IOU2(config-if)#ip add 192.168.1.11 255.255.255.0
IOU2(config-if)#ex
IOU2(config)#
IOU2(config)#int e0/0
IOU2(config-if)#du fu
IOU2(config-if)#ip add 192.168.0.1 255.255.255.0
IOU2(config-if)#no shut
IOU2(config-if)#ex
IOU2(config)#

IOU3配置

IOU3#conf t
IOU3(config)#int loo0
IOU3(config-if)#ip add 172.16.88.11 255.255.255.0
IOU3(config-if)#ex
IOU3(config)#
IOU3(config)#int e0/0
IOU3(config-if)#du fu
IOU3(config-if)#ip add 172.16.1.1 255.255.255.0
IOU3(config-if)#no shut
IOU3(config-if)#ex
IOU3(config)#

ASA-1配置

ciscoasa(config)# int g 0
ciscoasa(config-if)# nameif outside
INFO: Security level for "outside" set to 0 by default.
ciscoasa(config-if)# security-level 0
ciscoasa(config-if)# ip add 200.1.1.254 255.255.255.0
ciscoasa(config-if)# no shut
ciscoasa(config-if)# ex
ciscoasa(config)#
ciscoasa(config)# int g 1
ciscoasa(config-if)# nameif dmz
INFO: Security level for "dmz" set to 0 by default.
ciscoasa(config-if)# security-level 50
ciscoasa(config-if)# ip add 192.168.0.254 255.255.255.0
ciscoasa(config-if)# no shut
ciscoasa(config-if)# ex
ciscoasa(config)#
ciscoasa(config)# int g 2
ciscoasa(config-if)# nameif inside
INFO: Security level for "inside" set to 100 by default.
ciscoasa(config-if)# security-level 100
ciscoasa(config-if)# ip add 172.16.1.254 255.255.255.0
ciscoasa(config-if)# no shut
ciscoasa(config-if)# ex
ciscoasa(config)#


二、配置默认、静态路由

IOU2配置

IOU2(config)#ip route 0.0.0.0 0.0.0.0 192.168.0.254 
IOU2(config)#

IOU3配置

IOU3(config)#ip route 0.0.0.0 0.0.0.0 172.16.1.254
IOU3(config)#

ASA-1配置

ciscoasa(config)# route outside 0 0 200.1.1.1
ciscoasa(config)# route dmz 192.168.1.0 255.255.255.0 192.168.0.1
ciscoasa(config)# route inside 172.16.88.0 255.255.255.0 172.16.1.1
ciscoasa(config)#

配置完在ASA-1上使用show rotue 查看路由表

ASA思科防火墙NAT配置_路由表_02


在IOU1上配置telnet

IOU1(config)#username bdqn privilege 15 password 123
IOU1(config)#line vty 0 4
IOU1(config-line)#login local
IOU1(config-line)#transport input telnet
IOU1(config-line)#exit
IOU1(config)#


三、配置动态NAT

定义动态NAT地址池

ciscoasa(config)# object network out-pool
ciscoasa(config-network-object)# range 200.1.1.10 200.1.1.20
ciscoasa(config-network-object)# ex
ciscoasa(config)#

指定内网网段

ciscoasa(config)# object network in-ld
ciscoasa(config-network-object)# subnet 172.16.88.0 255.255.255.0
ciscoasa(config-network-object)# ex
ciscoasa(config)#
ciscoasa(config)# object network in-xd
ciscoasa(config-network-object)# subnet 172.16.1.0 255.255.255.0
ciscoasa(config-network-object)# ex
ciscoasa(config)#
ciscoasa(config)# object network dmz-1
ciscoasa(config-network-object)# subnet 192.168.0.0 255.255.255.0
ciscoasa(config-network-object)# ex
ciscoasa(config)#
ciscoasa(config)# object network dmz-2
ciscoasa(config-network-object)# subnet 192.168.1.0 255.255.255.0
ciscoasa(config-network-object)# ex
ciscoasa(config)#

创建内网地址组

ciscoasa(config)# object-group network in-lan
ciscoasa(config-network-object-group)# network-object object in-ld
ciscoasa(config-network-object-group)# network-object object in-xd
ciscoasa(config-network-object-group)# ex
ciscoasa(config)#
ciscoasa(config)# object-group network dmz-lan
ciscoasa(config-network-object-group)# network-object object dmz-1
ciscoasa(config-network-object-group)# network-object object dmz-2
ciscoasa(config-network-object-group)# ex
ciscoasa(config)#

配置NAT

ciscoasa(config)# nat (inside,outside) source dynamic in-lan out-pool
ciscoasa(config)# nat (dmz,outside) source dynamic dmz-lan out-pool
ciscoasa(config)#


测试能否telnet外网200.1.1.1

ASA思科防火墙NAT配置_内网_03


完成!