ACL访问控制列表实验
拓扑图
实验要求
1、基本配置按照上图规划
2、RT1~RT5运行OSPF协议,区域0,实现全网互通
3、在TR5上开启ftp和telnet服务
4、RT4 可以访问 RT5的 TELNET 服务,但不能访问 FTP 服务
5、PC1不能与RT5进行通信(高级ACL)
实验配置
一、修改设备名、添加ip地址
略
二、RT1~RT5运行OSPF协议,宣告网段
配置略,最终RT1和RT3上均有两个邻居
- RT5上开启FTP服务和TELNET服务
注意:同一个local-user不能同时开启两个服务,会冲突,导致其中一个服务登录不进去,最好一个服务对应一个用户
ftp用户设置:
[RT5]ftp server enable
[RT5]local-user ftp
New local user added.
[RT5-luser-manage-ftp]password simple 123456@qwer
[RT5-luser-manage-ftp]service-type ftp
[RT5-luser-manage-ftp]authorization-attribute user-role level-15
Telnet用户设置:
[RT5]telnet server enable
[RT5]local-user wr
New local user added.
[RT5-luser-manage-wr]password simple 123456@qwer
[RT5-luser-manage-wr]authorization-attribute user-role level-15
[RT5-luser-manage-wr]service-type telnet
[RT5]line vty 0 4
[RT5-line-vty0-4]authentication-mode scheme
[RT5-line-vty0-4]user-role level-15
[RT5-line-vty0-4]protocol inbound telnet
-
在RT1的G0/0口应用高级ACL
[RT1]acl advanced 3000
[RT1-acl-ipv4-adv-3000]rule 5 deny tcp source 172.16.1.4 0 destination 192.168.1.5 0 destination-port eq 21
[RT1-GigabitEthernet0/1]packet-filter 3000 inbound
效果:RT4访问RT5的FTP和telnet
- 在RT1的G0/0口应用高级ACL
[RT1-acl-ipv4-adv-3001]
[RT1-acl-ipv4-adv-3001]rule 5 deny icmp source 10.1.1.2 0 destination 192.168.1.5 0
[RT1]int g0/0
[RT1-GigabitEthernet0/0]packet-filter 3001 inbound
效果