计算机网络-配置路由器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,成功:

相关推荐
AnalogElectronic8 小时前
考研408计算机学科专业基础综合——计算机网络复习
计算机网络·考研
y = xⁿ9 小时前
(小林coding) 计算机网络学习笔记:什么是HTTP?
笔记·学习·计算机网络
头疼的程序员10 小时前
计算机网络:自顶向下方法(第七版)第八章 学习分享(一)
网络·学习·计算机网络
watersink10 小时前
第14章 计算机网络
计算机网络
千千寰宇21 小时前
[网络协议/文件] `SMB` 协议:一种Windows主流的局域网网络文件共享协议
计算机网络·操作系统-磁盘管理/文件系统
哇蛙蛙1 天前
H3CNE--21.RIP
网络·经验分享·网络协议·tcp/ip·计算机网络·智能路由器
孙严Pay1 天前
快捷支付和网关支付,到底有啥不一样?
笔记·科技·计算机网络·其他·微信
大地的一角2 天前
(计算机网络)传输层协议原理
网络协议·计算机网络·udp
DARLING Zero two♡2 天前
【计算机网络】简学深悟启示录:udp&&tcp协议
tcp/ip·计算机网络·udp
头疼的程序员2 天前
计算机网络:自顶向下方法(第七版)第七章 学习分享(四)
网络·学习·计算机网络