标准与扩展ACL实验

一标准访问控制列表实验:

实验拓扑:

 

实验目的:掌握标准与扩展ACL的配置

实验要求:拒绝R1到R3的所有流量

实验步骤:

步骤1 按如上拓扑做好底层配置,并检测相邻设备之间的连通性

步骤2起静态路由,使全网互通

R1(config)#ip route 10.1.1.64 255.255.255.252 10.1.1.2

R3(config)#ip route 10.1.1.0 255.255.255.252 10.1.1.65

步骤3R3上做标准的ACL使R1不能访问R3

R3(config)#access-list 1 deny 10.1.1.1 0.0.0.0

或者使用命令

R3(config)#access-list 1 deny host 10.1.1.1

因为访问控制列表默认有一个拒绝所有的隐含条目,所以需要在最后加入一条:

R3(config)#access-list 1 permit any

标准ACL要放置在离目标近的地方,所以配置在R3S1的入向上面:

R3(config)#int s1

R3(config-if)#ip access-group 1 in

二 扩展访问控制列表实验:

实验拓扑:

实验目的:掌握扩展访问控制列表的配置

掌握如何使用扩展的访问控制列表实现网络的安全性

实验要求:拒绝任何来自192.168.1.0网络的icmp流量

只有PC1可以访问FTP服务器

实验步骤:步骤1按如上拓扑在做好底层配置,在三台路由器上启RIPv2协议,使之互通

R1(config)#router rip

R1(config-router)#version 2

R1(config-router)#no auto-summary

R1(config-rotuer)#network 10.0.0.0

R1(config-rotuer)#network 172.16.0.0

R2(config)#router rip

R2(config-router)#version 2

R2(config-router)#no auto-summary

R2(config-rotuer)#network 10.0.0.0

R3(config)#router rip

R3(config-router)#version 2

R3(config-router)#no auto-summary

R3(config-rotuer)#network 10.0.0.0

R3(config-router)#network 192.168.1.0

步骤3R3上做扩展的ACL,拒绝来自192.168.1.0网络的icmp流量

R3(config)#access-list 102 deny icmp 192.168.1.0 0.0.0.255 any

R3(config)#access-list 102 permit ip any any

R3(config)#int e0

R3(config-if)ip access-group 102 in

步骤4R1上做扩展的ACL使得只有PC1可以访问FTP服务器

注意FTP使用两个端口号,2021

R1(config)#access-list 110 permit tcp 192.168.1.1 0.0.0.0 172.16.1.2 0.0.0.0 eq 21

R1(config)#access-list 110 permit tcp 192.168.1.1 0.0.0.0 172.16.1.2 0.0.0.0 eq 20

R1(config)#int s0

R1(config-if)#ip access-group 110 in

三 命名的访问控制列表试验:

实验需求与拓扑图通上,将访问控制列表转换成命名的ACL

R3(config)#ip access-list extended deny_icmp

R3(config-ext-nacl)#deny icmp 192.168.1.0 0.0.0.255 any

R3(config-ext-nacl)#permit ip any any

R3(config)#int e0

R3(config-if)#ip access-group deny_icmp in

R1(config)#ip access-list extended deny_ftp

R1(config-ext-nacl)#permit tcp 192.168.1.1 0.0.0.0 172.16.1.2 0.0.0.0 eq 20

R1(config-ext-nacl)#permit tcp 192.168.1.1 0.0.0.0 172.16.1.2 0.0.0.0 eq 21

R1(config)#int s0

R1(config-if)#ip access-group deny_ftp in

命名ACL的最大优点在于可以修改其中任意一条,而使用编号的ACL则不能。

四:使用ACL对vty线路进行限制:

实验拓扑:

实验需求:在Router的VTY线路上通过ACL限制访问

只有PC1能够远程登录Router

实验步骤:

Router(config)#access-list 1 permit host 172.16.1.3

//因为ACL有隐含拒绝特性,所以不需要显式拒绝PC2

Router(config)#line vty 0 15

Router(config-line)#password stsd

Router(config-line)#login

Router(config-line)#access-class 1 in

原文地址:https://www.cnblogs.com/fatt/p/4353759.html