HCIA---ACL实验

一、实验要求

要求:
1.PC可以telnet R1 ,但不能ping R1 ;PC1 可以ping R2,但不能Telnet R2
2.PC2 与 PC1 相反

注意:因为模拟器PC不能做telnet,所以用俩太路由器模拟PC

在这里插入图片描述

二、拓扑图

在这里插入图片描述

三、IP地址规划

这图很简单,所用的IP也很少

设备IP地址
R1g0/0/0 192.168.1.1 /24 g0/0/1 192.168.2.1/ 24
R2g0/0/0 192.168.2.2 /24
PC1192.168.1.10
PC2192.168.1.11

四、配置信息

R1的IP配置:

[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 24
[r1-GigabitEthernet0/0/0]int g 0/0/1
[r1-GigabitEthernet0/0/1]ip add 192.168.2.1 24

在这里插入图片描述

R2的IP配置:

[r2]int g 0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.2.2 24

在这里插入图片描述
PC1配置信息:

[pc1]int g 0/0/0
[pc1-GigabitEthernet0/0/0]ip add 192.168.1.10 24

PC2配置信息:

[pc2]int g 0/0/0
[pc2-GigabitEthernet0/0/0]ip add 192.168.1.11 24

R1 R2开启 aaa认证:

[r1]aaa		
[r1-aaa]local-user an privilege level 15 password cipher 123456
Info: Add a new user.
[r1-aaa]local-user an service-type telnet 
[r1-aaa]quit 
[r1]user-interface vty 0 
[r1-ui-vty0]authentication-mode aaa
[r2]aaa    	
[r2-aaa]local-user an privilege level 15 password cipher 123456
Info: Add a new user.	
[r2-aaa]local-user an service-type telnet
[r2]user-interface vty 0 4
[r2-ui-vty0-4]authentication-mode aaa

IP配置完后,做一个缺省路由

[pc1]ip route-static 0.0.0.0 0 192.168.1.1
[pc2]ip route-static 0.0.0.0 0 192.168.1.1 

此时可以全网可达;测试结果:
在这里插入图片描述
在这里插入图片描述
接下来做ACL来抓取感兴趣流量:
根据题目要求,这里需要做一个高级ACL,配置如下:

[r1-acl-adv-3000]display  this 
[V200R003C00]
#
acl number 3000  
 rule 5 deny icmp source 192.168.1.10 0 destination 192.168.1.1 0 
 rule 10 deny icmp source 192.168.1.10 0 destination 192.168.2.1 0 
 rule 15 deny tcp source 192.168.1.10 0 destination 192.168.2.2 0 
 rule 20 deny tcp source 192.168.1.10 0 destination 192.168.2.2 0 destination-po
rt eq telnet 
 rule 25 deny tcp source 192.168.1.11 0 destination 192.168.1.1 0 destination-po
rt eq telnet 
 rule 30 deny tcp source 192.168.1.11 0 destination 192.168.2.1 0 destination-po
rt eq telnet 
 rule 35 deny icmp source 192.168.1.11 0 destination 192.168.2.2 0 
#
return
[r1]acl 3000
[r1-acl-adv-3000]rule deny icmp source 192.168.1.10 0.0.0.0 destination 192.168.
1.1 0.0.0.0 
[r1-acl-adv-3000]rule deny icmp source 192.168.1.10 0.0.0.0 destination 192.168.
2.1 0.0.0.0	
[r1-acl-adv-3000]rule deny tcp source 192.168.1.10 0.0.0.0 destination 192.168.2
.2 0.0.0.0 destination-port eq 23
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]traffic-filter inbound acl 3000
[r1]acl 3000
[r1-acl-adv-3000]rule deny tcp source 192.168.1.11 0.0.0.0 destination 192.168.
2.1 0.0.0.0 destination-port eq 23
[r1-acl-adv-3000]rule deny icmp source 192.168.1.11 0.0.0.0 destination 192.168.
2.2 0.0.0.0 

最终测试结果:

PC1测试结果:
在这里插入图片描述
在这里插入图片描述

PC2 测试结果:
在这里插入图片描述
在这里插入图片描述

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值