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

相关推荐
2501_9160088921 小时前
HTTPS 抓包遇到证书绑定怎么办,使用 TraceEagle 解除 App 证书校验
网络协议·计算机网络·http·网络安全·ios·adb·https
zx1154501 天前
前后端开发必备的计算机网络知识
计算机网络
砚凝霜2 天前
软考网络工程师|第 1 章 计算机网络基础 完整备考笔记
网络·笔记·计算机网络
TechEdu2026062 天前
[计算机科学]计算机网络原理
计算机网络·计算机科学
谙弆悕博士2 天前
系统集成项目管理工程师教程(第3版)笔记——第2章:信息技术发展
笔记·计算机网络·信息安全·学习方法·业界资讯·软考·系统分析师
ttod_qzstudio3 天前
【软考备考】计算机网络详解:OSI/TCP-IP 分层 + IP 子网划分,一篇拿下网络模块(附 10 道练习)
网络·tcp/ip·计算机网络·软考
2301_808414383 天前
计算机网络基础
计算机网络
Lhappy嘻嘻3 天前
网络(四)|全网最细网络层原理:IP 协议、IP 地址分类、子网划分、路由转发、NAT 穿透详解
java·笔记·网络协议·计算机网络
儒雅的烤地瓜5 天前
计算机网络 | 网络诊断双刃剑:Tracert路由追踪实战与Windows防火墙端口配置指南
tcp/ip·计算机网络·wireshark·防火墙·powershell·cmd
2501_915106326 天前
TraceEagle 代理抓包教程 本机和手机的 HTTPS 抓包方法
网络协议·计算机网络·网络安全·ios·adb·https·udp