栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

HCIA---ACL实验

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

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 测试结果:

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/731275.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号