温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

基于GNS3的ASA 5520虚拟防火墙功能测试

发布时间:2020-07-18 18:07:32 来源:网络 阅读:632 作者:goldream 栏目:安全技术

目的:
测试基于GNS3的ASA 8.4(2)的部分功能配置:
1 内网客户端访问外网;
2 外网访问内网服务器;
3 Lan-to-Lan IPSEC ×××;

####################################################################################
实验拓扑:
基于GNS3的ASA 5520虚拟防火墙功能测试

####################################################################################
一 内网客户端通过防火墙访问外网
PC:设置IP 192.168.1.2,gateway: 192.168.1.1
R1: F0/0 192.168.1.1/24
F1/0 192.168.2.1/24
Default gateway: ip route 0.0.0.0 0.0.0.0192.168.2.2

ASA-1:
interface GigabitEthernet0
nameif inside
security-level 100
ip address 192.168.2.2 255.255.255.0
!
interface GigabitEthernet1
nameif outside
security-level 0
ip address 172.16.1.1 255.255.255.0
access-list in-2-out extended permit ip any any
access-group in-2-out in interface outside
nat (inside,outside) source dynamic any interface

route outside 0.0.0.0 0.0.0.0 172.16.1.2 1
route inside 192.168.1.0 255.255.255.0 192.168.2.1 1

测试:
PC-1> ping 172.16.1.3
84 bytes from 172.16.1.3 icmp_seq=1 ttl=254 time=269.845 ms
84 bytes from 172.16.1.3 icmp_seq=2 ttl=254 time=101.949 ms
84 bytes from 172.16.1.3 icmp_seq=3 ttl=254 time=159.903 ms
84 bytes from 172.16.1.3 icmp_seq=4 ttl=254 time=181.896 ms
84 bytes from 172.16.1.3 icmp_seq=5 ttl=254 time=208.890 ms

R1#ssh -l root 172.16.1.3
Password:
R3>

#####################################################################################
二 外网访问内网服务器
前面配置不变,添加如下配置:
object network 172.16.1.10
host 172.16.1.10 #公网地址
object network 2.1_telnet
host 192.168.2.1 #内网地址
nat (inside,outside) static 172.16.1.10 service tcp telnet telnet #映射地址
注:外部接口的端口映射始终无法做通,尝试了不同方法,
1 添加policy;
2 添加策略。
始终不行,怀疑是防火墙版本或者虚拟机的问题,其余配置如下:
object network 2.1_ssh
host 192.168.2.1
nat (inside,outside) static interface service tcp ssh ssh

测试结果:
R3#telnet 172.16.1.10
Trying 172.16.1.10 ... Open
User Access Verification
Username: root
Password:
R1>en

##################################################################################
三 L2L IPSEC ×××
前面配置不变,添加如下配置:
object network inside
subnet 192.168.1.0 255.255.255.0 #定义本端网络地址

object network remote-site-address #定义远端网络地址
subnet 192.168.4.0 255.255.255.0

nat (inside,outside) source static inside inside destination static remote-site-address remote-site-address # 设置感兴趣流避免NAT

crypto ipsec ikev1 transform-set test esp-3des esp-md5-hmac
crypto map crymap 10 match address ***
crypto map crymap 10 set peer 172.16.1.2
crypto map crymap 10 set ikev1 transform-set test
crypto map crymap interface outside
crypto ikev1 enable outside #定义 crypto map参数并应用到外网接口,172.16.1.2为对端公网
地址。

crypto ikev1 policy 10
authentication pre-share
encryption 3des
hash md5
group 2
lifetime 86400 #定义 IPSEC第一阶段加密参数

tunnel-group 172.16.1.2 type ipsec-l2l
tunnel-group 172.16.1.2 ipsec-attributes
ikev1 pre-shared-key ***** #定义隧道类型并设置第一阶段共享密码

测试:
PC-1> ping 192.168.4.2
192.168.4.2 icmp_seq=1 timeout
192.168.4.2 icmp_seq=2 timeout
84 bytes from 192.168.4.2 icmp_seq=3 ttl=62 time=229.871 ms
84 bytes from 192.168.4.2 icmp_seq=4 ttl=62 time=400.765 ms
84 bytes from 192.168.4.2 icmp_seq=5 ttl=62 time=91.948 ms
注意:由于刚开始隧道还没有建议,因此会有几个丢包,正常!

对端PING
PC-2> ping 192.168.1.2
84 bytes from 192.168.1.2 icmp_seq=1 ttl=62 time=350.800 ms
84 bytes from 192.168.1.2 icmp_seq=2 ttl=62 time=228.867 ms
84 bytes from 192.168.1.2 icmp_seq=3 ttl=62 time=206.881 ms
84 bytes from 192.168.1.2 icmp_seq=4 ttl=62 time=299.828 ms
84 bytes from 192.168.1.2 icmp_seq=5 ttl=62 time=284.829 ms

################################################################################
ASA部分诊断命令如下:
show run nat
show run object-network
show run object-group
show nat detail
show xlate
show conn
show nat pool
debug nat 255

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI