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)
相关推荐
安红豆.13 分钟前
Linux基础入门 --13 DAY(SHELL脚本编程基础)
linux·运维·操作系统
..空空的人13 分钟前
linux基础指令的认识
linux·运维·服务器
penny_tcf13 分钟前
Linux基础命令halt详解
linux·运维·服务器
鱼跃鹰飞17 分钟前
Leecode热题100-295.数据流中的中位数
java·服务器·开发语言·前端·算法·leetcode·面试
什么鬼昵称23 分钟前
Pikachu-xxe-xxe漏洞
网络·安全·xxe
N1cez34 分钟前
vscode 连接服务器 不用输密码 免密登录
服务器·vscode
杨哥带你写代码1 小时前
构建高效新闻推荐系统:Spring Boot的力量
服务器·spring boot·php
万界星空科技1 小时前
界星空科技漆包线行业称重系统
运维·经验分享·科技·5g·能源·制造·业界资讯
荣世蓥1 小时前
10.2 Linux_进程_进程相关函数
linux·运维·服务器