「ACL」- 场景及方案

配置使用(Huawei)

创建基本 ACL 规则

# 使用编号(2000~2999)创建一个数字型的基本 ACL,并进入基本 ACL 视图;
[Huawei] acl [ number ] acl-number [ match-order config ]

# 使用名称创建一个命名型的基本 ACL,并进入基本 ACL 视图;
[Huawei] acl name <acl-name> { basic | acl-number } [ match-order config ]

配置基本 ACL 规则

# 在基本 ACL 视图下,通过此命令来配置基本 ACL 的规则;
[Huawei-acl-basic-2000] rule [ rule-id ] { deny | permit } [ source { source-address source-wildcard | any } | time-range time-name ]

创建高级 ACL 规则:

# 使用编号(3000~3999)创建一个数字型的高级 ACL,并进入高级 ACL 视图;
[Huawei] acl [ number ] acl-number [ match-order config ]

# 使用名称创建一个命名型的高级 ACL,进入高级 ACL 视图;
[Huawei] acl name acl-name { advance | acl-number } [ match-order config ]

配置高级 ACL 规则:

# 使当参数 protocol 为 IP 时,高级 ACL 的命令格式为
rule [ rule-id ] { deny | permit } ip [ destination { destination-address destination-wildcard | any } | source { source-address source-wildcard | any } | time-range time-name | [ dscp dscp | [ tos tos | precedence precedence ] ] ]

# 当参数 protocol 为 TCP 时,高级 ACL 的命令格式为
rule [ rule-id ] { deny | permit } { protocol-number | tcp } [ destination { destination-address destination-wildcard | any } | destination-port { eq port | gt port | lt port | range port-start port-end } | source { source-address source-wildcard | any } | source-port { eq port | gt port | lt port | range port-start port-end } | tcp-flag { ack | fin | syn } * | time-range time-name ] *