首页/网络/网络设备配置速查/规则编号、匹配顺序与步长
ACL 与安全65 条

规则编号、匹配顺序与步长

ACL 从上到下逐条匹配、命中即停止:编号顺序决定优先级,插入规则要靠预留的步长编号。

网络设备配置速查网络更新于 2026-10-12
场景调整规则优先级或插入新规则
适用三厂
步长华为/H3C 默认 step 5,可插 5/6/7…;思科编号 ACL 顺序即配置顺序

华为 VRP

华为 VRP
acl number 3000
 rule 5 permit tcp destination-port eq 80
 rule 6 deny   tcp destination 10.1.1.10 0 destination-port eq 80
display acl 3000   # 按 ID 升序展示匹配计数

思科 IOS

思科 IOS
ip access-list extended WEB
 5 permit tcp any any eq 80
 6 deny tcp any host 10.1.1.10 eq 80
show ip access-lists WEB

H3C Comware

H3C Comware
acl advanced 3000
 rule 5 permit tcp destination-port eq 80
 rule 6 deny  tcp destination 10.1.1.10 0 destination-port eq 80
display acl 3000
差异:思科命名 ACL 显示为 10/20/30 自动序号,可显式写序号插入;编号 ACL 只能整体删除后重建,无法插入单条。

易错点

  • 想插到 5 与 10 之间却没有中间编号,只能重排整段 ACL

数据来源与参考

  • Cisco IOS 命名 ACL 序号(sequence number)说明
  • 华为 VRP ACL 规则排序(step)
  • H3C Comware ACL rule ID 与 step

相关工具

​‌‌​​‌​​​‌‌​‌‌‌‌​‌‌​​​‌‌​‌‌‌​​‌‌​​‌​‌‌‌​​‌‌‌​​​‌​‌‌​‌​​‌​‌‌‌​​​‌​‌‌​‌​​‌​‌‌​​​‌‌​‌‌‌​‌​​​‌‌​‌‌‌‌​​‌​‌‌‌​​‌‌​​​‌‌​‌‌​‌‌‌‌​‌‌​‌‌​‌