一、拓扑图软件:GNS3 2.1.9 二、要求: 1、inside里面的PC1、Server01能够ping 通 117.184.14.213 2、将inside里面的Server01 的23端口映射到公网2300端口 3、dmz里面的Server02能ping通117.184.14.213 4、将 dmz 里面的Server02 的23 端口映射到公网 300端口 5、inside 里面的PC1、Server01 通ping 通dmz 里面的Server02 三、配置: 3.1、ASA配置: 接口配置: conf t int g0 no sh nameif inside ip add 192.168.100.254 255.255.255.0 intg g1 no sh nameif outside ip add 117.184.14.214 255.255.255.252 int g2 no sh nameif dmz sec 50 ip add 172.16.1.1 255.255.255.0 exit 路由配置: route outside 0.0.0.0 0.0.0.0 117.184.14.213 route inside 192.168.1.0 255.255.255.0 192.168.100.1 route inside 192.168.20.0 255.255.255.0 192.168.100.1 outside、dmz 允许ping access-list yuxunp permit icmp any any access-group yuxunp in interface dmz access-group yuxunp in interface outside Inside 区域做NAT,以及Inside里面的服务器做端口映射。 ciscoasa(config)# object network in_out_pat ciscoasa(config-network-object)# subnet 0.0.0.0 0.0.0.0 ciscoasa(config-network-object)# nat (inside,outside) dynamic interface ciscoasa(config-network-object)# exit 端口映射 ciscoasa(config)# object network oa236 ciscoasa(config-network-object)# host 192.168.1.236 ciscoasa(config-network-object)# nat (inside,outside) static int ser tcp 23 2300 ciscoasa(config-network-object)# exit 访问控制列表(因为入站流量是禁止的,所以需要ACL来放行。) ciscoasa(config)# access-list in_23 permit tcp any object oa236 eq 23 ciscoasa(config)# access-group in_23 in int outside DMZ区域做 NAT,以及DMZ里面的服务器做端口映射。 ciscoasa(config)# object network dmz_out_pat ciscoasa(config-network-object)# subnet 172.16.1.0 255.255.255.0 ciscoasa(config-network-object)# nat (dmz,outside) dynamic interface ciscoasa(config-network-object)# exit 端口映射 ciscoasa(config)# object network dmz_ser02_ys ciscoasa(config-network-object)# host 172.16.1.10 ciscoasa(config-network-object)# nat (dmz,outside) static int ser tcp 23 300 ciscoasa(config-network-object)# exit 访问控制列表(因为入站流量是禁止的,所以需要ACL来放行。) ciscoasa(config)# access-list dmz_in23 permit tcp any object dmz_ser02_ys eq 23 ciscoasa(config)# access-group dmz_in23 in int outside 3.2、R1配置: 接口配置: conf t int f0/0 ip add 192.168.100.1 255.255.255.0 no sh exit int f1/0 ip add 192.168.1.1 255.255.255.0 no sh exit int f0/1 ip add 192.168.20.1 255.255.255.0 no sh exit 路由配置: conf t ip route 0.0.0.0 0.0.0.0 192.168.100.254 3.3、Internet设备配置: 接口配置: conf t int f0/0 no sh ip add 117.154.14.213 255.255.255.252 exit int f0/1 ip add 10.10.10.1 255.255.255.0 no sh 3.4、web_pc配置 conf t int f0/0 no sh ip add 10.10.10.2 255.255.255.0 exit ip route 0.0.0.0 0.0.0.0 10.10.10.1 3.5、PC1配置: conf t int f0/0 no sh ip add 192.168.20.20 255.255.255.0 exit ip route 0.0.0.0 0.0.0.0 192.168.20.1 3.6、Server01配置: conf t int f0/0 no sh ip add 192.168.1.236 255.255.255.0 exit ip route 0.0.0.0 0.0.0.0 192.168.1.1 line vty 0 4 password windows@123 login exit 3.7、Server02配置 conf t int f0/0 no sh ip add 172.16.1.10 255.255.255.0 exit ip route 0.0.0.0 0.0.0.0 172.16.1.1 line vty 0 4 password windows@123 login exit 四、测试: 4.1、在web_pc 上面telnet 117.184.14.214 2300 和 300 端口。
![]()
4.2、PC1、Server01 上面ping Server02的IP
![]()
4.3、PC1、Server01、Server02 上面ping 117.184.14.213
![]()
![]()
![]()