华为ACL配置教程.docx

上传人:b****1 文档编号:2360720 上传时间:2023-05-03 格式:DOCX 页数:43 大小:27.27KB
下载 相关 举报
华为ACL配置教程.docx_第1页
第1页 / 共43页
华为ACL配置教程.docx_第2页
第2页 / 共43页
华为ACL配置教程.docx_第3页
第3页 / 共43页
华为ACL配置教程.docx_第4页
第4页 / 共43页
华为ACL配置教程.docx_第5页
第5页 / 共43页
华为ACL配置教程.docx_第6页
第6页 / 共43页
华为ACL配置教程.docx_第7页
第7页 / 共43页
华为ACL配置教程.docx_第8页
第8页 / 共43页
华为ACL配置教程.docx_第9页
第9页 / 共43页
华为ACL配置教程.docx_第10页
第10页 / 共43页
华为ACL配置教程.docx_第11页
第11页 / 共43页
华为ACL配置教程.docx_第12页
第12页 / 共43页
华为ACL配置教程.docx_第13页
第13页 / 共43页
华为ACL配置教程.docx_第14页
第14页 / 共43页
华为ACL配置教程.docx_第15页
第15页 / 共43页
华为ACL配置教程.docx_第16页
第16页 / 共43页
华为ACL配置教程.docx_第17页
第17页 / 共43页
华为ACL配置教程.docx_第18页
第18页 / 共43页
华为ACL配置教程.docx_第19页
第19页 / 共43页
华为ACL配置教程.docx_第20页
第20页 / 共43页
亲,该文档总共43页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

华为ACL配置教程.docx

《华为ACL配置教程.docx》由会员分享,可在线阅读,更多相关《华为ACL配置教程.docx(43页珍藏版)》请在冰点文库上搜索。

华为ACL配置教程.docx

华为ACL配置教程

华为ACL配置教程

一、ACL基本配置

1、ACL规则生效时间段配置(需要先配置设备的时间,建议用ntp同步时间)

某些引用ACL的业务或功能需要限制在一定的时间围生效,比如,在流量高峰期时启动设备的QoS功能。

用户可以为ACL创建生效时间段,通过在规则中引用时间段信息限制ACL生效的时间围,从而达到该业务或功能在一定的时间围生效的目的。

[Huawei]time-rangetest?

 

mm> Startingtime

 from    Thebeginningpointofthetimerange

 

[Huawei]time-rangetest8:

00?

 to Theendingpointofperiodictime-range

 

[Huawei]time-rangetest8:

00t      

[Huawei]time-rangetest8:

00to?

 

mm> EndingTime

 

[Huawei]time-rangetest8:

00to18:

05?

 <0-6>       Dayoftheweek(0isSunday)

 Fri         Friday  #星期五

 Mon         Monday#星期一

 Sat         Saturday#星期六

 Sun         Sunday#星期天

 Thu         Thursday# 星期四

 Tue         Tuesday# 星期二

 Wed         Wednesday#星期三

 daily       Everydayoftheweek # 每天

 off-day     SaturdayandSunday# 星期六和星期日

 working-day MondaytoFriday#工作日每一天

 

[Huawei]time-rangetestfrom8:

002016/1/17to18:

002016/11/17

 

使用同一time-name可以配置多条不同的时间段,以达到这样的效果:

各周期时间段之间以及各绝对时间段之间分别取并集之后,再取二者的交集作为最终生效的时间围。

例如,时间段“test”配置了三个生效时段:

从2016年1月1日00:

00起到2016年12月31日23:

59生效,这是一个绝对时间段。

在周一到周五每天8:

00到18:

00生效,这是一个周期时间段。

在周六、周日下午14:

00到18:

00生效,这是一个周期时间段。

则时间段“test”最终描述的时间围为:

2016年的周一到周五每天8:

00到18:

00以及周六和周日下午14:

00到18:

00。

由于网络延迟等原因,可能造成网络上设备时间不同步,建议配置NTP(NetworkTimeProtocol),以保证网络上时间的一致。

 

 

2、ACL类型配置

2.1、数字型acl配置

[Huawei]acl2000match-order?

 auto   Autoorder#自动顺序(默认)

 config Configorder

[Huawei]aclnumber2000match-order?

 auto   Autoorder

 config Configorder

 

2.2、命名型acl配置

[Huawei]aclnametest?

 advance     SpecifyanadvancednamedACL# 设置高级acl

 basic       SpecifyabasicnamedACL

 match-order SetACL'smatchorder

 number      SpecifyanumberforthenamedACL

         

 

[Huawei]aclnametestad       

[Huawei]aclnametestadvance?

 match-order SetACL'smatchorder

 number      SpecifyanumberforthenamedACL

   

 

[Huawei]aclnametestnumber?

 INTEGER<2000-2999>   NumberofthebasicnamedACL

 INTEGER<42768-75535> NumberoftheadvancednamedACL

 

2.3、ACL类型配置

[Huawei]acl?

 INTEGER<1000-1999>   Interfaceaccess-list(addtocurrentusingrules)# 接口访问列表acl

 INTEGER<10000-10999> ApplyMPLSACL # 应用MPLSACL

 INTEGER<2000-2999>   Basicaccess-list(addtocurrentusingrules)# 基本acl

 INTEGER<3000-3999>   Advancedaccess-list(addtocurrentusingrules)# 高级acl

 INTEGER<4000-4999>   MACaddressaccess-list(addtocurrentusingrules)# 二层acl

 ipv6                 ACLIPv6 # 基本acl6和高级acl6配置

 name                 SpecifyanamedACL

 number               SpecifyanumberedACL

 

2.4、ACL描述设置(可选)

[Huawei-acl-basic-2600]description?

            TEXT

2.5、ACL步长设置(可选)

[Huawei-acl-basic-test]step?

 INTEGER<1-20> Specifyvalueofstep

 

 

二、ACL类型规则配置

1、基本ACL规则配置

基本ACL编号acl-number的围是2000~2999。

基本ACL可以根据报文自身的源IP地址、分片标记和时间段信息对IPv4报文进行分类。

[Huawei-acl-basic-test]rule1?

 deny   Specifymatchedpacketdeny

 permit Specifymatchedpacketpermit

 

 [Huawei-acl-basic-test]rule1deny?

 fragment-type Specifythefragmenttypeofpacket# 分组片段类型

 source        Specifysourceaddress

 time-range    Specifyaspecialtime

 vpn-instance  SpecifyaVPN-Instance

           

                  

 [Huawei-acl-basic-test]rule1denysource?

 X.X.X.X Addressofsource

 any     Anysource

 

[Huawei-acl-basic-test]rule1denysource192.168.1.1?

 0       Wildcardbits:

0.0.0.0(ahost)

 X.X.X.X Wildcardofsource

 

[Huawei-acl-basic-test]rule1denysource192.168.1.10?

 fragment-type Specifythefragmenttypeofpacket# 对分组片段类型有效

 time-range    Specifyaspecialtime# 引用生效时间

 vpn-instance  SpecifyaVPN-Instance# 用于vpn

  

 

[Huawei-acl-basic-2600]description?

#配置规则描述

                  TEXT ACLdescription(nomorethan127characters)

 

在ACL中配置首条规则时,如果未指定参数rule-id,设备使用步长值作为规则的起始编号。

后续配置规则如仍未指定参数rule-id,设备则使用最后一个规则的rule-id的下一个步长的整数倍数值作为规则编号。

例如ACL中包含规则rule5和rule7,ACL的步长为5,则系统分配给新配置的未指定rule-id的规则的编号为10。

当用户指定参数time-range引入ACL规则生效时间段时,如果time-name不存在,该规则将无法绑定该生效时间段。

如果不指定参数vpn-instancevpn-instance-name,设备会对公网和私网的报文均进行匹配。

设备在收到报文时,会按照匹配顺序将报文与ACL规则进行逐条匹配,一旦匹配上规则组的某条规则,则停止匹配动作。

之后,设备将依据匹配的规则对报文执行相应的动作。

2、高级ACL规则配置

高级ACL编号acl-number的围是3000~3999。

高级acl主要对源/目的IP地址、端口号、优先级、时间段等报文进行过滤。

[Huawei-acl-adv-3000]rule1permit?

 <1-255> Protocolnumber

 gre     GREtunneling(47)

 icmp    InternetControlMessageProtocol

(1)

 igmp    InternetGroupManagementProtocol

(2)

 ip      AnyIPprotocol

 ipinip  IPinIPtunneling(4)

 ospf    OSPFroutingprotocol(89)

 tcp     TransmissionControlProtocol(6)

 udp     UserDatagramProtocol(17)

 

 [Huawei-acl-adv-3000]rule1permitudp?

 destination      Specifydestinationaddress

 destination-port Specifydestinationport

 dscp             Specifydscp

 fragment-type    Specifythefragmenttypeofpacket

 precedence       Specifyprecedence

 source           Specifysourceaddress

 source-port      Specifysourceport

 time-range       Specifyaspecialtime

 tos              Specifytos

 vpn-instance     SpecifyaVPN-Instance

              

 

 [Huawei-acl-adv-3000]rule1permitudpsource?

 X.X.X.X Addressofsource

 any     Anysource

 

 [Huawei-acl-adv-3000]rule1permitudpsourceany?

 destination      Specifydestinationaddress

 destination-port Specifydestinationport

 dscp             Specifydscp

 fragment-type    Specifythefragmenttypeofpacket

 precedence       Specifyprecedence

 source-port      Specifysourceport

 time-range       Specifyaspecialtime

 tos              Specifytos

 vpn-instance     SpecifyaVPN-Instance

              

 

[Huawei-acl-adv-3000]rule1permitudpsourceanydes       

[Huawei-acl-adv-3000]rule1permitudpsourceanydestination?

 X.X.X.X Specifydestinationaddress

 any     AnydestinationIPaddress

 

[Huawei-acl-adv-3000]rule1permitudpsourceanydestination192.168.1.1?

 0       Wildcardbits:

0.0.0.0(ahost)

 X.X.X.X Wildcardofdestination

 

[Huawei-acl-adv-3000]rule1permitudpsourceanydestination192.168.1.10?

 destination-port Specifydestinationport

 dscp             Specifydscp

 fragment-type    Specifythefragmenttypeofpacket

 precedence       Specifyprecedence

 source-port      Specifysourceport

 time-range       Specifyaspecialtime

 tos              Specifytos

 vpn-instance     SpecifyaVPN-Instance

              

 

[Huawei-acl-adv-3000]rule1permitudpsourceanydestination192.168.1.10destination-port?

 eq    Equaltogivenportnumber

 gt    Greaterthangivenportnumber

 lt    Lessthangivenportnumber

 neq   Notequaltogivenportnumber # 不等于指定端口

 range Betweentwoportnumbers

 

 [Huawei-acl-adv-3000]rule1permitudpsourceanydestination192.168.1.10destination-port eq?

 <0-65535>   Protocolnumber

 biff        Mailnotify(512)

 bootpc      BootstrapProtocolClient(68)

 bootps      BootstrapProtocolServer(67)

 discard     Discard(9)

 dns         DomainNameService(53)

 dnsix       DNSIXSecurityAttributeTokenMap(90)

 echo        Echo(7)

 mobilip-ag  MobileIP-Agent(434)

 mobilip-mn  MobilIP-MN(435)

 nameserver  HostNameServer(42)

 netbios-dgm NETBIOSDatagramService(138)

 netbios-ns  NETBIOSNameService(137)

 netbios-ssn NETBIOSSessionService(139)

 ntp         NetworkTimeProtocol(123)

 rip         RoutingInformationProtocol(520)

 snmp        SNMP(161)

 snmptrap    SNMPTRAP(162)

 sunrpc      SUNRemoteProcedureCall(111)

 syslog      Syslog(514)

 tacacs-ds   TACACS-DatabaseService(65)

 talk        Talk(517)

 tftp        TrivialFileTransfer(69)

 time        Time(37)

 who         Who(513)

 xdmcp       XDisplayManagerControlProtocol(177)

 

[Huawei-acl-adv-3000]rule1permitudpsourceanydestination192.168.1.10destination-porteq 21?

 dscp          Specifydscp

 fragment-type Specifythefragmenttypeofpacket

 precedence    Specifyprecedence

 source-port   Specifysourceport

 time-range    Specifyaspecialtime

 tos           Specifytos

 vpn-instance  SpecifyaVPN-Instance

   

 

高级acl可以匹配的功能有:

2.1、高级acl常用协议数值对照表

协议类型

数值

ICMP

1

IGMP

2

IPinIP

4

TCP

6

UDP

17

GRE

47

IP

OSPF

89

 

2.2、高级acl常用功能说明

参数

说明

deny

拒绝符合条件的报文

permit

允许符合条件的报文

source{sour-addrsour-wildcard|any}

sour-addrsour-wildcard:

源ip地址  源通配符掩码

any:

任意源IP地址

destination{dest-addrdest-wildcaard|any

dest-addrdest-wildcaard:

目的IP地址及通配符掩码

any:

任意目的IP地址

icmp-type{icmp-name|icmp-typeicmp-code}

指定acl规则匹配报文的icmp报文的类型和消息码信息,仅在报文协议是ICMP的情况下有效

precedence

指定acl匹配报文时依据优先级字段进行过滤。

与tos 参数一起共同构成DSCP组成的二选一参数。

tos

指定acl匹配报文时依据服务类型字段进行过滤。

与precedence参数一起共同构成DSCP组成的二选一参数。

dscp

指定acl匹配报文时区分服务代码点,依据IP包中的DSCP优先级字段进行过滤。

tcp-flag

指定acl规则匹配TCP报文中的SYN标志的类型

time-range

指定acl规则生效时间段

destination-port{eqprot|gtport|ltport|rageport-startportend}

指定acl规则匹配报文的UDP或TCP的目的端口,仅在报文协议是UDP或TCP时生效。

端口号可用名称或数字表示

eqport:

指定等于目的端口

gtport:

指定大于目的端口

ltport:

指定小于目的端口

rangeport-startport-end:

指定目的端口围 start 为起始端口 end为结束端口

soure-port{eqprot|gtport|ltport|rageport-startportend}

指定acl规则匹配报文的UDP或TCP的源端口,仅在报文协议是UDP或TCP时生效。

loging

指定acl匹配的报文信息进行日志记录

fragmen

指定acl规则是否仅对非首片分片报文有效,当包含此参数时仅对非首片分片报文有效。

但此参数不能同时与source-port、destination-port、icmp-type、tcp-flag参数同时配置。

ttl-expired

指定acl是否依据数据报文中的ttl值是否为1进行过滤。

启用此命令表示过滤。

5700SI及以下版本不支持。

举例:

拒绝192.168.1.0网段与主机61.128.128.68进行UDP 9090通信

[Huawei-acl-adv-3002]ruledeny udpsource192.168.1.00.0.0.255destination61.128.128.680.destination-porteq9090

3、二层ACL规则配置

二层ACL编号acl-number的围是4000~4999。

二层acl对源/目的MAC、802.1p优先级、二层协议等二层信息进行过滤。

 

[Huawei-acl-L2-4000]rule1?

 deny     

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 工程科技 > 能源化工

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2