lib9-02 配置扩展 ACL

实验:配置扩展 ACL

1、实验目的

  • 通过本实验可以掌握
  • 编号扩展 ACL 定义和应用的方法
  • 命名扩展 ACL 定义和应用的方法

2、实验拓扑

实验拓扑如下图所示。使用扩展 ACL 实现如下访问控制

  • 拒绝 PC1 所在网段访问 Server1 的 Web 服务
  • 拒绝 PC2 所在网段访问 Server1 的 FTP 服务
  • 拒绝 PC1 所在网段访问 Server1 的 DNS 服务
  • 拒绝 PC1 所在网段访问路由器 R3 的 Telnet 服务
  • 拒绝 PC2 所在网段访问路由器 R2 的 Web 服务
  • 拒绝 PC1 和 PC2 所在的网段 ping Server1
  • 只允许 R3 以接口 s2/0 为源 ping R2 的接口 s2/0 的 IP 地址,不允许 R2 以接口 s2/1 为源 ping R3 的接口 s2/0 的 IP 地址,即单向 ping。

3、实验步骤

(1)配置路由器R1

复制代码
R1(config)#access-list 110 remark This is an example for IPv4 extended ACL
R1(config)#access-list 110 deny tcp 172.16.1.0 0.0.0.255 host 172.16.3.100 eq 80  
R1(config)#access-list 110 deny tcp 172.16.2.0 0.0.0.255 host 172.16.3.100 eq 21       
R1(config)#access-list 110 deny tcp 172.16.2.0 0.0.0.255 host 172.16.3.100 eq 20
R1(config)#access-list 110 deny udp 172.16.1.0 0.0.0.255 host 172.16.3.100 eq 53       
R1(config)#access-list 110 deny tcp 172.16.1.0 0.0.0.255 host 172.16.23.3 eq 23        
R1(config)#access-list 110 deny tcp 172.16.1.0 0.0.0.255 host 172.16.3.254 eq 23
R1(config)#access-list 110 deny tcp 172.16.2.0 0.0.0.255 host 172.16.12.2 eq 80        
R1(config)#access-list 110 deny tcp 172.16.2.0 0.0.0.255 host 172.16.23.2 eq 80        
R1(config)#access-list 110 deny icmp 172.16.1.0 0.0.0.255 host 172.16.3.100 log        
R1(config)#access-list 110 deny icmp 172.16.2.0 0.0.0.255 host 172.16.3.100 log
R1(config)#access-list 110 permit ip any any 
R1(config)#interface serial 2/0
R1(config-if)#ip access-group 110 out
R1(config-if)#exit

(2)配置路由器R2

复制代码
R2(config)#username cisco privilege 15 secret cisco
R2(config)#ip http server
R2(config)#ip http authentication local 

(3)配置路由器R3

复制代码
R3(config)#access-list 120  deny icmp host 172.16.23.2 host 172.16.23.3 echo log        
R3(config)#access-list 120 permit ip any any 
R3(config)#interface serial 2/0
R3(config-if)#ip access-group 120 in
R3(config-if)#exit

4、实验调试

(1)查看IPv4 ACL及流量匹配情况,

复制代码
R1#show ip access-lists 110
Extended IP access list 110
    10 deny tcp 172.16.1.0 0.0.0.255 host 172.16.3.100 eq www
    20 deny tcp 172.16.2.0 0.0.0.255 host 172.16.3.100 eq ftp
    30 deny tcp 172.16.2.0 0.0.0.255 host 172.16.3.100 eq ftp-data
    40 deny udp 172.16.1.0 0.0.0.255 host 172.16.3.100 eq domain
    50 deny tcp 172.16.1.0 0.0.0.255 host 172.16.23.3 eq telnet
    60 deny tcp 172.16.1.0 0.0.0.255 host 172.16.3.254 eq telnet
    70 deny tcp 172.16.2.0 0.0.0.255 host 172.16.12.2 eq www
    80 deny tcp 172.16.2.0 0.0.0.255 host 172.16.23.2 eq www
    90 deny icmp 172.16.1.0 0.0.0.255 host 172.16.3.100 log
    100 deny icmp 172.16.2.0 0.0.0.255 host 172.16.3.100 log
    110 permit ip any any

(2)查看日志信息

(3)在路由器R3查看扩展IPv4 ACL 120

复制代码
R3#show ip access-lists 120
Extended IP access list 120
    10 deny icmp host 172.16.23.2 host 172.16.23.3 echo log
    20 permit ip any any (6 matches)
相关推荐
碳基沙盒11 小时前
OpenClaw 多 Agent 配置实战指南
运维
Sinclair2 天前
简单几步,安卓手机秒变服务器,安装 CMS 程序
android·服务器
Rockbean3 天前
用40行代码搭建自己的无服务器OCR
服务器·python·deepseek
蝎子莱莱爱打怪3 天前
Centos7中一键安装K8s集群以及Rancher安装记录
运维·后端·kubernetes
茶杯梦轩3 天前
CompletableFuture 在 项目实战 中 创建异步任务 的核心优势及使用场景
服务器·后端·面试
海天鹰4 天前
【免费】PHP主机=域名+解析+主机
服务器
DianSan_ERP4 天前
电商API接口全链路监控:构建坚不可摧的线上运维防线
大数据·运维·网络·人工智能·git·servlet
呉師傅4 天前
火狐浏览器报错配置文件缺失如何解决#操作技巧#
运维·网络·windows·电脑
不是二师兄的八戒4 天前
Linux服务器挂载OSS存储的完整实践指南
linux·运维·服务器
芝士雪豹只抽瑞克五4 天前
Nginx 高性能Web服务器笔记
服务器·nginx