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

相关推荐
平头哥在等你2 小时前
《计算机网络名词解释》
服务器·网络·计算机网络
ALLinLLM2 小时前
使用反向代理软件frp在局域网内共享上网
计算机网络·veee
biemowomaomao9 小时前
计算机网络
计算机网络
爱吃涮毛肚的肥肥(暂时吃不了版)9 小时前
计算机网络34——Windows内存管理
网络·计算机网络·udp
Static_Xiao1 天前
计算机网络 8.*结构化布线
计算机网络
XF鸭1 天前
计算机网络各层有哪些协议?
网络·计算机网络
尸僵打怪兽1 天前
软考(中级-软件设计师)(0919)
java·c语言·数据库·计算机网络·软考·多媒体·软件设计师
FHKHH1 天前
计算机网络第二章:作业 1: Web 服务器
服务器·前端·计算机网络
小堃学编程2 天前
计算机网络(七) —— https协议与网络安全证书
计算机网络·web安全·https
秋夫人2 天前
DoS、DDoS、DRDoS 攻击
计算机网络·ddos