计算机网络-配置路由器ACL(访问控制列表)

配置访问控制列表ACL

拓扑结构

拓扑结构如下:

要配置一个ACL,禁止PC0访问PC3,禁止PC4访问PC0,其它正常。

配置Router0

配置接口IP地址:

shell 复制代码
interface fastethernet 0/0
ip address 192.168.1.1 255.255.255.0
no shutdown

interface fastethernet 0/1
ip address 10.0.0.1 255.255.255.0
no shutdown

创建并配置ACL:禁止pc0访问pc3

shell 复制代码
access-list 100 deny ip host 192.168.1.2 host 192.168.2.2
access-list 100 permit ip any any

应用ACL到接口:

shell 复制代码
interface fastethernet 0/0
ip access-group 100 in
end
show access-list

配置Router1

  1. 配置接口IP地址:
shell 复制代码
interface fastethernet 0/0
ip address 192.168.2.1 255.255.255.0
no shutdown

interface fastethernet 0/1
ip address 10.0.0.2 255.255.255.0
no shutdown

创建并配置ACL:禁止pc4访问pc0

shell 复制代码
access-list 101 deny ip host 192.168.2.3 host 192.168.1.2
access-list 101 permit ip any any

应用ACL到接口:

shell 复制代码
interface fastethernet 0/0
ip access-group 101 in
end
show access-list

验证配置

在Router5上查看ACL配置:

shell 复制代码
show access-lists 100

在Router6上查看ACL配置:

shell 复制代码
show access-lists 101

测试连接:

从PC0 ping PC3,失败:

复制代码
ping 192.168.2.2

从PC0 ping 其它pc,成功:

从PC4 ping PC0,失败:

复制代码
ping 192.168.1.2

从PC4 ping 其它pc,成功:

相关推荐
艾厶烤的鱼19 小时前
架构-计算机网络
计算机网络·架构
丰锋ff1 天前
计算机网络学习笔记
笔记·学习·计算机网络
尤物程序猿1 天前
【2025计算机网络-面试常问】http和https区别是什么,http的内容有哪些,https用的是对称加密还是非对称加密,流程是怎么样的
计算机网络·http·面试
YGGP2 天前
【每日八股】复习计算机网络 Day4:TCP 协议的其他相关问题
网络·tcp/ip·计算机网络
噗噗bug2 天前
计算机网络 3-4 数据链路层(局域网)
服务器·网络·计算机网络
xiao--xin2 天前
计算机网络笔记(六)——1.6计算机网络的性能
笔记·计算机网络·带宽·计算机基础·性能指标·吞吐量·时延
满怀10152 天前
【计算机网络】现代网络技术核心架构与实战解析
网络协议·tcp/ip·计算机网络·架构·云计算·网络工程
一只蒟蒻ovo2 天前
计算机网络 第二章:应用层(四)
网络·计算机网络
fei_sun3 天前
【计算机网络】第五章 局域网技术
服务器·网络·计算机网络
梁下轻语的秋缘3 天前
计算机网络 实验五 RIP的配置与应用
网络·计算机网络·智能路由器