华为ensp-三层ACL与二层ACL的场景小实验

本文详细描述了如何在AR1、AR2、AR3和AR4路由器上配置三层和二层ACL策略,包括使用高级ACL3000和基础ACL4000,以及针对PC123和PC456的测试结果。
摘要由CSDN通过智能技术生成

实验需求

配置思路

首先你要知道ACL有几种,如下

所以答案自然就清晰明了了,方式1可以通过高级acl3000完成,方式2通过acl4000完成

配置答案

pc123和pc456配置相同

三层acl配置

AR1

路由器基本配置
 sysname AR1
#
interface GigabitEthernet0/0/0
 ip address 192.168.1.254 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 10.1.12.1 255.255.255.0 
#
ip route-static 192.168.2.0 255.255.255.0 10.1.12.2

MQC模版配置
acl number 3000  
 rule 5 deny ip source 192.168.1.2 0 destination 192.168.2.0 0.0.0.255 
#
traffic classifier tc1 operator or
 if-match acl 3000
#
traffic behavior tb1
 deny
#
traffic policy tp1
 classifier tc1 behavior tb1

接口调用
interface GigabitEthernet0/0/0
 traffic-policy tp1 inbound


AR2

路由器基本配置
interface GigabitEthernet0/0/0
 ip address 10.1.12.2 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 192.168.2.254 255.255.255.0 
#
ip route-static 192.168.1.0 255.255.255.0 10.1.12.1

二层acl配置

AR3

路由器基本配置
 sysname AR3
#
interface GigabitEthernet0/0/0
 ip address 192.168.1.254 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 10.1.12.1 255.255.255.0 
#
ip route-static 192.168.2.0 255.255.255.0 10.1.12.2

MQC模版配置
acl number 4000  
 rule 5 deny source-mac 5489-9867-5702
#
traffic classifier tc1 operator or
 if-match acl 4000
#
traffic behavior tb1
 deny
#
traffic policy tp1
 classifier tc1 behavior tb1

接口调用
interface GigabitEthernet0/0/0
 traffic-policy tp1 inbound


AR4

路由器基本配置
interface GigabitEthernet0/0/0
 ip address 10.1.12.2 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 192.168.2.254 255.255.255.0 
#
ip route-static 192.168.1.0 255.255.255.0 10.1.12.1

测试结果

三层acl

二层acl

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值