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)
相关推荐
努力努力再努力wz3 分钟前
【c++深入系列】:类和对象详解(下)
java·运维·c语言·开发语言·c++
BuHuaX7 分钟前
C#的反射机制
服务器·unity·c#·游戏引擎·游戏程序
不爱学英文的码字机器18 分钟前
隐私计算的崛起:数据安全的未来守护者
服务器·算法
a123_z22 分钟前
.NET 创建MCP使用大模型对话二:调用远程MCP服务
运维·服务器
葟雪儿32 分钟前
Docker常用命令
linux·服务器·spring cloud·docker·微服务·容器
木盏40 分钟前
Linux终止进程(kill process)的一些玩法
linux·运维·深度学习
Fanche40440 分钟前
Linux-CentOS-7—— 安装MySQL 8
linux·运维·数据库·mysql·centos
橘子1340 分钟前
Linux信号——信号的处理(3)
linux·运维·服务器
CZIDC1 小时前
Nginx搭建API网关服务教程-系统架构优化 API统一管理
运维·nginx·系统架构
Algorithm15762 小时前
linux如何查看当前系统的资源占用情况
linux·运维·服务器