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

相关推荐
自我陶醉@15 小时前
计算机网络---物理层
计算机网络·考研·学习方法·408
没书读了20 小时前
考研复习-计算机网络-第五章-传输层
计算机网络·考研
njxiejing20 小时前
考研408计算机网络近年第34题真题解析(2021-2024.34)
计算机网络·考研
青衫码上行20 小时前
【计算机网络 | 第14篇】应用层协议
计算机网络
yanxing.D2 天前
计算机网络——第一章 计算机网络体系结构
计算机网络·408
njxiejing2 天前
考研408计算机网络2023-2024年第33题解析
计算机网络·考研
自我陶醉@3 天前
计算机网络---网络体系结构
网络·计算机网络·考研·智能路由器·408
没书读了3 天前
考研复习-计算机网络-第四章-网络层
计算机网络·考研
A.sir啊3 天前
计算机网络知识点梳理(一)概述:组成、发展、性能、体系结构等
tcp/ip·计算机网络·osi·计算机网络体系结构·分组交换·时延·互联网发展的三个阶段
岑梓铭4 天前
计算机网络第四章(4)——网络层《ARP协议》
网络·笔记·tcp/ip·计算机网络·考研·408