华为ACL配置教程

合集下载

华为路由器通过ACL(访问控制列表)限制上网

华为路由器通过ACL(访问控制列表)限制上网

华为路由器:通过ACL(访问控制列表)限制上网默认分类2009-06-10 07:52:48 阅读79 评论0 字号:大中小登录到路由器telnet 192.168.1.1输入用户名,密码acl number 3000 (如果不存在,创建访问列表;存在则添加一条限制)允许192.168.1.99上网:rule 10 permit ip source 192.168.1.99 0 destination 0.0.0.0 0.0.0.0说明:192.168.1.99 0 表示允许192.168.1.99这台主机,0表示本机。

rule 规则编号ip source 主机反子网掩码destination 目的IP 反子网掩码如果要允许多个连续IP上网:rule 11 permit ip source 192.168.1.16 0.0.0.15 destination 0.0.0.0 0.0.0.0表示允许192.168.1.16/28 即:192.168.1.17-192.168.1.30可以上网同样,可以限制某IP只能访问某一个网站:例如,允许192.168.1.98这台主机只能访问rule 13 permit ip source 192.168.1.98 0 destination 121.14.89.14 0某个网站的IP:可以打开命令提示符,ping (以百度为例)最后不要忘记:rule 12 deny any any 把不符合以上规则的数据都过滤掉,这样只有上面列出的ip才可以上网。

写的不够详细,敬请原谅。

在华为2880路由器上如何设置时间限制的acl列表?请各位指教首先建立时间段,例如//建立一个时间段,名为work,时间定义为每天08:00到17:00 timer-ange work 07:00 to 17:00 daily然后在acl语句后加上time-range work即可,例如rule 10 permit tcp destination-port eq pop3 time-range work1)定义上班时间段# 定义8:00至18:00的周期时间段。

华为交换机ACL控制列表设置

华为交换机ACL控制列表设置

交换机配置〔三〕ACL基本配置1,二层ACL. 组网需求:通过二层访问控制列表,实现在每天8:00~18:00时间段内对源MAC为00e0-fc01-0101目的MAC为00e0-fc01-0303报文的过滤.该主机从GigabitEthernet0/1接入..配置步骤:<1>定义时间段# 定义8:00至18:00的周期时间段.[Quidway] time-range huawei 8:00 to 18:00 daily<2>定义源MAC为00e0-fc01-0101目的MAC为00e0-fc01-0303的ACL# 进入基于名字的二层访问控制列表视图,命名为traffic-of-link.[Quidway] acl name traffic-of-link link#定义源MAC为00e0-fc01-0101目的MAC为00e0-fc01-0303的流分类规则. [Quidway-acl-link-traffic-of-link] rule 1 deny ingress 00e0-fc01-0101 0-0-0 egress00e0-fc01-0303 0-0-0 time-range huawei<3>激活ACL.# 将traffic-of-link的ACL激活.[Quidway-GigabitEthernet0/1] packet-filter link-group traffic-of-link2三层ACL a>基本访问控制列表配置案例. 组网需求:通过基本访问控制列表,实现在每天8:00~18:00时间段内对源IP为10.1.1.1主机发出报文的过滤.该主机从GigabitEthernet0/1接入..配置步骤:<1>定义时间段# 定义8:00至18:00的周期时间段.[Quidway] time-range huawei 8:00 to 18:00 daily<2>定义源IP为10.1.1.1的ACL# 进入基于名字的基本访问控制列表视图,命名为traffic-of-host.[Quidway] acl name traffic-of-host basic# 定义源IP为10.1.1.1的访问规则.[Quidway-acl-basic-traffic-of-host] rule 1 deny ip source 10.1.1.1 0 time-range huawei<3>激活ACL.# 将traffic-of-host的ACL激活.[Quidway-GigabitEthernet0/1] packet-filter inbound ip-group traffic-of-hostb>高级访问控制列表配置案例.组网需求:公司企业网通过Switch的端口实现各部门之间的互连.研发部门的由GigabitEthernet0/1端口接入,工资查询服务器的地址为129.110.1.2.要求正确配置ACL,限制研发部门在上班时间8:00至18:00访问工资服务器..配置步骤:<1>定义时间段# 定义8:00至18:00的周期时间段.定义时间-ACL规则创建-设定规则-激活规则[Quidway] time-range huawei 8:00 to 18:00 working-day<2>定义到工资服务器的ACL# 进入基于名字的高级访问控制列表视图,命名为traffic-of-payserver.[Quidway] acl name traffic-of-payserver advanced# 定义研发部门到工资服务器的访问规则.[Quidway-acl-adv-traffic-of-payserver] rule 1 deny ip source any destination 129.110.1.2 0.0.0.0 time-range huawei<3>激活ACL.# 将traffic-of-payserver的ACL激活.[Quidway-GigabitEthernet0/1] packet-filter inbound ip-group traffic-of-payserver3,常见病毒的ACL创建aclacl number 100禁pingrule deny icmp source any destination any用于控制Blaster蠕虫的传播rule deny udp source any destination any destination-port eq 69rule deny tcp source any destination any destination-port eq 4444用于控制冲击波病毒的扫描和攻击rule deny tcp source any destination any destination-port eq 135rule deny udp source any destination any destination-port eq 135rule deny udp source any destination any destination-port eq netbios-nsrule deny udp source any destination any destination-port eq netbios-dgmrule deny tcp source any destination any destination-port eq 139rule deny udp source any destination any destination-port eq 139rule deny tcp source any destination any destination-port eq 445rule deny udp source any destination any destination-port eq 445rule deny udp source any destination any destination-port eq 593rule deny tcp source any destination any destination-port eq 593用于控制振荡波的扫描和攻击rule deny tcp source any destination any destination-port eq 445rule deny tcp source any destination any destination-port eq 5554rule deny tcp source any destination any destination-port eq 9995rule deny tcp source any destination any destination-port eq 9996用于控制Worm_MSBlast.A 蠕虫的传播rule deny udp source any destination any destination-port eq 1434下面的不出名的病毒端口号〔可以不作〕rule deny tcp source any destination any destination-port eq 1068rule deny tcp source any destination any destination-port eq 5800rule deny tcp source any destination any destination-port eq 5900rule deny tcp source any destination any destination-port eq 10080rule deny tcp source any destination any destination-port eq 455rule deny udp source any destination any destination-port eq 455rule deny tcp source any destination any destination-port eq 3208rule deny tcp source any destination any destination-port eq 1871rule deny tcp source any destination any destination-port eq 4510rule deny udp source any destination any destination-port eq 4334rule deny tcp source any destination any destination-port eq 4331rule deny tcp source any destination any destination-port eq 4557然后下发配置packet-filter ip-group 100目的:针对目前网上出现的问题,对目的是端口号为1434的UDP报文进行过滤的配置方法,详细和复杂的配置请看配置手册.NE80的配置:NE80<config>#rule-map r1 udp any any eq 1434//r1为role-map的名字,udp 为关键字,any any 所有源、目的IP,eq为等于,1434为udp端口号NE80<config>#acl a1 r1 deny//a1为acl的名字,r1为要绑定的rule-map的名字,NE80<config-if-Ethernet1/0/0>#access-group acl a1//在1/0/0接口上绑定acl,acl为关键字,a1为acl的名字NE16的配置:NE16-4<config>#firewall enable all//首先启动防火墙NE16-4<config>#access-list 101 deny udp any any eq 1434//deny为禁止的关键字,针对udp报文,any any 为所有源、目的IP,eq为等于, 1434为udp 端口号NE16-4<config-if-Ethernet2/2/0>#ip access-group 101 in//在接口上启用access-list,in表示进来的报文,也可以用out表示出去的报文中低端路由器的配置[Router]firewall enable[Router]acl 101[Router-acl-101]rule deny udp source any destion any destination-port eq 1434[Router-Ethernet0]firewall packet-filter 101 inbound6506产品的配置:旧命令行配置如下:6506<config>#acl extended aaa deny protocol udp any any eq 14346506<config-if-Ethernet5/0/1>#access-group aaa国际化新命令行配置如下:[Quidway]acl number 100[Quidway-acl-adv-100]rule deny udp source any destination any destination-port eq 1434 [Quidway-acl-adv-100]quit[Quidway]interface ethernet 5/0/1[Quidway-Ethernet5/0/1]packet-filter inbound ip-group 100 not-care-for-interface5516产品的配置:旧命令行配置如下:5516<config>#rule-map l3 aaa protocol-type udp ingress any egress any eq 14345516<config>#flow-action fff deny5516<config>#acl bbb aaa fff5516<config>#access-group bbb国际化新命令行配置如下:[Quidway]acl num 100[Quidway-acl-adv-100]rule deny udp source any destination any destination-port eq 1434 [Quidway]packet-filter ip-group 1003526产品的配置:旧命令行配置如下:rule-map l3 r1 0.0.0.0 0.0.0.0 1.1.0.0 255.255.0.0 eq 1434flow-action f1 denyacl acl1 r1 f1access-group acl1国际化新命令配置如下:acl number 100rule 0 deny udp source 0.0.0.0 0 source-port eq 1434 destination 1.1.0.0 0packet-filter ip-group 101 rule 0注:3526产品只能配置外网对内网的过滤规则,其中1.1.0.0 255.255.0.0是内网的地址段. 8016产品的配置:旧命令行配置如下:8016<config>#rule-map intervlan aaa udp any any eq 14348016<config>#acl bbb aaa deny8016<config>#access-group acl bbb vlan 10 port all国际化新命令行配置如下:8016<config>#rule-map intervlan aaa udp any any eq 14348016<config>#eacl bbb aaa deny8016<config>#access-group eacl bbb vlan 10 port all防止同网段ARP欺骗的ACL一、组网需求:1. 二层交换机阻止网络用户仿冒网关IP的ARP攻击二、组网图:图1二层交换机防ARP攻击组网S3552P是三层设备,其中IP:100.1.1.1是所有PC的网关,S3552P上的网关MAC地址为000f-e200-3999.PC-B上装有ARP攻击软件.现在需要对S3026C_A进行一些特殊配置,目的是过滤掉仿冒网关IP的ARP报文.三、配置步骤对于二层交换机如S3026C等支持用户自定义ACL〔number为5000到5999〕的交换机,可以配置ACL来进行ARP报文过滤.全局配置ACL禁止所有源IP是网关的ARP报文acl num 5000rule 0 deny 0806 ffff 24 64010101 ffffffff 40rule 1 permit 0806 ffff 24 000fe2003999 ffffffffffff 34其中rule0把整个S3026C_A的端口冒充网关的ARP报文禁掉,其中斜体部分64010101是网关IP地址100.1.1.1的16进制表示形式.Rule1允许通过网关发送的ARP报文,斜体部分为网关的mac地址000f-e200-3999.注意:配置Rule时的配置顺序,上述配置为先下发后生效的情况.在S3026C-A系统视图下发acl规则:[S3026C-A] packet-filter user-group 5000这样只有S3026C_A上连网关设备才能够发送网关的ARP报文,其它主机都不能发送假冒网关的arp响应报文.三层交换机实现仿冒网关的ARP防攻击一、组网需求:1. 三层交换机实现防止同网段的用户仿冒网关IP的ARP攻击二、组网图图2三层交换机防ARP攻击组网三、配置步骤1.对于三层设备,需要配置过滤源IP是网关的ARP报文的ACL规则,配置如下ACL规则:acl number 5000rule 0 deny 0806 ffff 24 64010105 ffffffff 40rule0禁止S3526E的所有端口接收冒充网关的ARP报文,其中斜体部分64010105是网关IP地址的16进制表示形式.2.下发ACL到全局[S3526E] packet-filter user-group 5000仿冒他人IP的ARP防攻击一、组网需求:作为网关的设备有可能会出现错误ARP的表项,因此在网关设备上还需对用户仿冒他人IP的ARP攻击报文进行过滤.二、组网图:参见图1和图2三、配置步骤:1.如图1所示,当PC-B发送源IP地址为PC-D的arp reply攻击报文,源mac是PC-B 的mac <000d-88f8-09fa>,源ip是PC-D的ip<100.1.1.3>,目的ip和mac是网关〔3552P〕的,这样3552上就会学习到错误的arp,如下所示:--------------------- 错误arp表项--------------------------------IP Address MAC Address VLAN ID Port Name Aging Type100.1.1.4 000d-88f8-09fa 1 Ethernet0/2 20 Dynamic100.1.1.3 000f-3d81-45b4 1 Ethernet0/2 20 Dynamic从网络连接可以知道PC-D的arp表项应该学习到端口E0/8上,而不应该学习到E0/2端口上.但实际上交换机上学习到该ARP表项在E0/2.上述现象可以在S3552上配置静态ARP实现防攻击:arp static 100.1.1.3 000f-3d81-45b4 1 e0/82.在图2 S3526C上也可以配置静态ARP来防止设备学习到错误的ARP表项.3.对于二层设备〔S3050C和S3026E系列〕,除了可以配置静态ARP外,还可以配置IP+MAC+port绑定,比如在S3026C端口E0/4上做如下操作:am user-bind ip-addr 100.1.1.4 mac-addr 000d-88f8-09fa int e0/4端口绑定则IP为并且MAC为000d-88f8-09fa的ARP报文可以通过E0/4端口,仿冒其它设备的ARP报文则无法通过,从而不会出现错误ARP表项.四、配置关键点:此处仅仅列举了部分Quidway S系列以太网交换机的应用.在实际的网络应用中,请根据配置手册确认该产品是否支持用户自定义ACL和地址绑定.仅仅具有上述功能的交换机才能防止ARP欺骗.5,关于ACL规则匹配的说明a> ACL直接下发到硬件中的情况交换机中ACL可以直接下发到交换机的硬件中用于数据转发过程中的过滤和流分类.此时一条ACL中多个子规则的匹配顺序是由交换机的硬件决定的,用户即使在定义ACL时配置了匹配顺序也不起作用.ACL直接下发到硬件的情况包括:交换机实现QoS功能时引用ACL、硬件转发时通过ACL过滤转发数据等.b> ACL被上层模块引用的情况交换机也使用ACL来对由软件处理的报文进行过滤和流分类.此时ACL子规则的匹配顺序有两种:config〔指定匹配该规则时按用户的配置顺序〕和auto〔指定匹配该规则时系统自动排序,即按"深度优先"的顺序〕.这种情况下用户可以在定义ACL的时候指定一条ACL中多个子规则的匹配顺序.用户一旦指定某一条访问控制列表的匹配顺序,就不能再更改该顺序.只有把该列表中所有的规则全部删除后,才能重新指定其匹配顺序.ACL被软件引用的情况包括:路由策略引用ACL、对登录用户进行控制时引用ACL等.。

华为ACL配置教程

华为ACL配置教程

华为A C L配置教程 Hessen was revised in January 2021华为ACL配置教程一、ACL基本配置1、ACL规则生效时间段配置(需要先配置设备的时间,建议用ntp同步时间)某些引用ACL的业务或功能需要限制在一定的时间范围内生效,比如,在流量高峰期时启动设备的QoS功能。

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

[]time-range test<hh:mm> Starting timefrom The beginning point of the time range?[Huawei]time-range test 8:00to The ending point of periodic time-range?[Huawei]time-range test 8:00 t[Huawei]time-range test 8:00 to<hh:mm> Ending Time?[Huawei]time-range test 8:00 to 18:05<0-6> Day of the week(0 is Sunday)Fri Friday #星期五Mon Monday #星期一Sat Saturday #星期六Sun Sunday #星期天Thu Thursday #星期四Tue Tuesday #星期二Wed Wednesday #星期三daily Every day of the week #每天off-day Saturday and Sunday #星期六和星期日working-day Monday to Friday #工作日每一天?[Huawei]time-range test from 8:00 2016/1/17 to 18:00 2016/11/17?使用同一time-name可以配置多条不同的时间段,以达到这样的效果:各周期时间段之间以及各绝对时间段之间分别取并集之后,再取二者的交集作为最终生效的时间范围。

ACL访问控制列表的配置-高级ACL的配置示例-华为

ACL访问控制列表的配置-高级ACL的配置示例-华为

//拒绝PC1所在网段访问PC2
高级ACL的配置-在R1的接口上运用高级ACL
要求配置高级ACL,实现PC1所在网段不能访问PC2,但是PC1所在网段能够访问Server的www服务器,但不能访问f来自p服务。R1 G0/0/0
OSPF
G0/0/0 R2
12.1.1.1/24
12.1.1.2/24
G0/0/1 10.10.1.254/24
G0/0/1 10.10.2.254/24
G0/0/2 10.10.3.254/24
PC1 10.10.1.1/24
PC2 10.10.2.1/24
Server 10.10.3.1/24
[R1]interface G0/0/1
[R1-GigabitEthernet0/0/1]traffic-filter inbound acl 3000 //在接口的in方向应用ACL
G0/0/1 10.10.2.254/24
G0/0/2 10.10.3.254/24
PC1 10.10.1.1/24
PC2 10.10.2.1/24
Server 10.10.3.1/24
[R2-acl-adv-3000]rule 10 deny tcp source 10.10.1.0 0.0.0.255
Server 10.10.3.1/24
[R2]acl 3000
//定义一个高级acl3000
[R2-acl-adv-3000] rule 5 permit tcp source 10.10.1.0 0.0.0.255
destination 10.10.3.1 0 destination-port eq www //允许PC1所在网段访问server的www服务器

华为ACL配置过程

华为ACL配置过程
<ห้องสมุดไป่ตู้-255> Protocol number
gre GRE tunneling(47)
icmp Internet Control Message Protocol(1)
igmp Internet Group Management Protocol(2)
指定所需匹配的源IP,目标IP,源端口,目标端口
[R1-acl-adv-3000]rule 10 permit tcp source 1.1.1.1 0 destinati
on 2.2.2.2 0 destination-port eq 23
调用ACL并指定方向过滤流量
[R1-GigabitEthernet0/0/0]traffic-filter ?
配置ACL顺序:因为ACL匹配原则为自上而下匹配,有匹配即弹出
建议一定配置顺序,并且留有余量
[R1-acl-adv-3000]rule ?
INTEGER<0-4294967294> ID of ACL rule
指定ACL匹配规则(动作):
1.在过滤流量情况下,deny为拒绝(过滤),permit为允许(通过)
ip Any IP protocol
ipinip IP in IP tunneling(4)
ospf OSPF routing protocol(89)
tcp Transmission Control Protocol (6)
udp User Datagram Protocol (17)
2.
[R1-acl-adv-3000]rule 10 ?
deny Specify matched packet deny

华为路由器配置ACL

华为路由器配置ACL

华为AR 28-11的型号基本适用多数华为路由Login authenticationUsername:ztwindows (用户)Password:sys (进如系统视图)System View: return to User View with Ctrl+Z.[quidway]dis curr (查看当前系统配置信息)#sysname quidway (系统名称)#info-center loghost 192.168.0.232(指定信息中心配置信息,这个可以不要)#firewall enable(开起防火墙功能)#dns resolve (启动动态DNS解析功能)dns server 202.98.198.168(指定域名服务器IP地址)dns-proxy enable(启动动态DNS解析功能)#radius scheme system(指定radius配置信息创建scheme方案或者修改方案属性)radius scheme test (test方案名)#domain system#local-user ztwindowspassword cipher L_'-D*ST]8Z)9JV9LS027A!!service-type telnet terminallevel 3关键地方来了!#acl number 2000 (设置一个基本的ACL数值为2000)rule 0 permit source 192.168.0.0 0.0.0.255 (这里配置的时候你会知道其意思)rule 1 deny#acl number 3001 (设置端口过滤使得安全功能)rule 0 deny tcp source-port eq 3127rule 1 deny tcp source-port eq 1025rule 2 deny tcp source-port eq 5554rule 3 deny tcp source-port eq 9996rule 4 deny tcp source-port eq 1068rule 5 deny tcp source-port eq 135rule 6 deny udp source-port eq 135rule 7 deny tcp source-port eq 137rule 8 deny udp source-port eq netbios-nsrule 9 deny tcp source-port eq 138rule 10 deny udp source-port eq netbios-dgmrule 11 deny tcp source-port eq 139rule 12 deny udp source-port eq netbios-ssnrule 13 deny tcp source-port eq 593rule 14 deny tcp source-port eq 4444rule 15 deny tcp source-port eq 5800rule 16 deny tcp source-port eq 5900rule 18 deny tcp source-port eq 8998rule 19 deny tcp source-port eq 445rule 20 deny udp source-port eq 445rule 21 deny udp source-port eq 1434rule 30 deny tcp destination-port eq 3127rule 31 deny tcp destination-port eq 1025rule 32 deny tcp destination-port eq 5554rule 33 deny tcp destination-port eq 9996rule 34 deny tcp destination-port eq 1068rule 35 deny tcp destination-port eq 135rule 36 deny udp destination-port eq 135rule 37 deny tcp destination-port eq 137rule 38 deny udp destination-port eq netbios-nsrule 39 deny tcp destination-port eq 138rule 40 deny udp destination-port eq netbios-dgmrule 41 deny tcp destination-port eq 139rule 42 deny udp destination-port eq netbios-ssnrule 43 deny tcp destination-port eq 593rule 44 deny tcp destination-port eq 4444rule 45 deny tcp destination-port eq 5800rule 46 deny tcp destination-port eq 5900rule 48 deny tcp destination-port eq 8998rule 49 deny tcp destination-port eq 445rule 50 deny udp destination-port eq 445rule 51 deny udp destination-port eq 1434#interface Aux0 (这个不用解释了自己看就知道了)async mode flow#interface Ethernet0/0(设置以太网口0/0口)speed 100(设置以太网的带宽为100M)descrīption link_to_dianxin(以太网口标识我设置的意思是这个口是接如点心)tcp mss 2048(设置TCP 的MSS直最大为2048)ip address 220.172.*.* 255.255.255.192(这里是设置这个口的外网IP以及子网)nat outbound 2000(设置nat地址转换数值为2000)nat server protocol tcp global 220.172.*.* 15000 inside 192.168.0.232 15000(这些是我做的端口隐射)nat server protocol tcp global 220.172.*.* 15010 inside 192.168.0.232 15010nat server protocol tcp global 220.172.*.* 15030 inside 192.168.0.232 15030nat server protocol tcp global 220.172.*.* 15037 inside 192.168.0.232 15037nat server protocol tcp global 220.172.*.* 15047 inside 192.168.0.232 15047#interface Ethernet0/1(上面说过接口了这个是0/1口看懂上面就应该看懂这里了吧)speed 100desc rīption link_to_workgrouptcp mss 1536ip address 192.168.0.1 255.255.255.0nat outbound 2000(内网口可以不设置这项)#interface Serial0/0(这个自己看说明就知道什么用了)clock DTECLK1link-protocol pppshutdownip address ppp-negotiate#interface Tunnel0#interface NULL0#time-range daily 08:30 to 18:30 daily#FTP server enable (FT[服务器为打开做FTP不用隐射直接打开还有下面一项设置就行了)#ftp source-interface Ethernet0/1(指向FTP连接借口为以太网0/1口)#undo arp check enable(使得能ARP表项检测,这个可以根据自己在加上其他参数实现)#ip route-static 0.0.0.0 0.0.0.0 220.172.225.129 preference 60(这里是加上外网IP的网关)#user-interface con 0authentication-mode schemeuser-interface aux 0user-interface vty 0 4authentication-mode scheme#return[quidway]好了大家应该看得懂了吧对了支持中文方式命令为lan chin 缩写只要命令不冲突华为路由支持缩写然后大家要查看相关命令OR功能的话在命令行输入?就行了查看连续命令的话比如怎么转换中文就是lan空格?号就行了然后查看本缩写的相关命令比如就是lan?没空格回复:你做了端口过滤,为什么不应用到接口上?firewall packet-filter 3001 inboundfirewall packet-filter 3001 outbound。

华为ACL设置

华为ACL设置

一、要求如下禁止外网192.168.1.1访问服务器10.0.0.1 方案1#acl 2010rule 5 deny ip source 192.168.1.1 0#interface GigabitEthernet 0/0/1traffic-filter outbound acl 2010方案2#acl 2020rule 5 deny ip source 192.168.1.1 0#interface GigabitEthernet 0/0/24 #注意端口traffic-filter intbound acl 2020 #注意方向方案3#acl 3030rule 5 deny ip destination 192.168.1.1 0#interface GigabitEthernet 0/0/1traffic-filter inbound acl 3030方案4rule 5 deny ip destination 192.168.1.1 0#interface GigabitEthernet 0/0/24 #注意端口traffic-filter inbound acl 3040 #注意方向二、要求如下禁止服务器10.0.0.1访问外网方案1#acl 2010rule 5 deny ip source 10.0.0.1#interface GigabitEthernet 0/0/1traffic-filter inbound acl 2010方案2#acl 2020rule 5 deny ip source 10.0.0.1#interface GigabitEthernet 0/0/24traffic-filter outbound acl 2020方案3#acl 3030rule 5 deny ip destination 10.0.0.1 0#interface GigabitEthernet 0/0/1traffic-filter outbound acl 3030方案4#acl 3030rule 5 deny ip destination 10.0.0.1 0#interface GigabitEthernet 0/0/24traffic-filter inbound acl 3030三、只允许192.168.1.1用户可以访问10.0.0.1方案1#acl 3010rule 5 permit ip destination 192.168.1.1 0rule 10 deny ip#interface GigabitEthernet0/0/1traffic-filter inbound acl 3010四、如果服务器配置了双IP 只允许192.168.1.1用户可以访问10.0.0.1不能访问10.0.0.2 方案1#acl 3010rule 5 permit ip source 192.168.1.1 0 destination 10.0.0.1 0rule 10 deny ip#interface GigabitEthernet0/0/1traffic-filter outbound acl 3010方案2rule 5 permit ip destination 10.0.0.1 0 source 192.168.1.1 0 rule 10 deny ip#interface GigabitEthernet0/0/1traffic-filter outbound acl 3020。

ACL访问控制列表的配置-标准ACL的配置示例-华为

ACL访问控制列表的配置-标准ACL的配置示例-华为

OSPF
G0/0/0 R2 12.1.1.2/24
G0/0/1 10.10.1.254/24
G0/0/1 10.10.2.254/24
G0/0/2 10.10.3.254/24
PC1 10.10.1.1/24
PC2 10.10.2.1/24
Server 10.10.3.1/24
[R1]ospf 1 router-id 1.1.1.1 [R1-ospf-1]area 0 [R1-ospf-1-area-0.0.0.0]network 12.1.1.0 0.0.0.255 [R1-ospf-1-area-0.0.0.0]network 10.10.1.0 0.0.0.255
[R2]interface G0/0/1
[R2-GigabitEthernet0/0/1]traffic-filter outbound acl 2000 //在接口的out方向应用ACL

R1 G0/0/0 12.1.1.1/24
OSPF
G0/0/0 R2 12.1.1.2/24
G0/0/1 10.10.1.254/24
G0/0/1 10.10.2.254/24
G0/0/2 10.10.3.254/24
PC1 10.10.1.1/24
PC2 10.10.2.1/24
Server 10.10.3.1/24
//拒绝源为10.10.1.0/24网段的所有流量
[R2-acl-basic-2000]rule 10 permit source any //允许所有的其他流量通过
标准ACL的配置-在R2的接口上运用标准ACL
要求配置标准ACL,实现PC1所在网段不能访问PC2,但是PC1所在网段能够访问Server。
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

华为ACL配置教程一、ACL基本配置1、ACL规则生效时间段配置(需要先配置设备的时间,建议用ntp同步时间)某些引用ACL的业务或功能需要限制在一定的时间范围内生效,比如,在流量高峰期时启动设备的QoS功能。

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

[Huawei]time-range test ?<hh:mm> Starting timefrom The beginning point of the time range[Huawei]time-range test 8:00 ?to The ending point of periodic time-range[Huawei]time-range test 8:00 t[Huawei]time-range test 8:00 to ?<hh:mm> Ending Time[Huawei]time-range test 8:00 to 18:05 ?<0-6> Day of the week(0 is Sunday)Fri Friday #星期五Mon Monday #星期一Sat Saturday #星期六Sun Sunday #星期天Thu Thursday # 星期四Tue Tuesday # 星期二Wed Wednesday #星期三daily Every day of the week # 每天off-day Saturday and Sunday # 星期六和星期日working-day Monday to Friday #工作日每一天[Huawei]time-range test from 8:00 2016/1/17 to 18:00 2016/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 (Network Time Protocol),以保证网络上时间的一致。

2、ACL类型配置2.1、数字型acl配置[Huawei]acl 2000 match-order ?auto Auto order #自动顺序(默认)config Config order或[Huawei]acl number 2000 match-order ?auto Auto orderconfig Config order2.2、命名型acl配置[Huawei]acl name test ?advance Specify an advanced named ACL # 设置高级aclbasic Specify a basic named ACLmatch-order Set ACL's match ordernumber Specify a number for the named ACL<cr>[Huawei]acl name test ad[Huawei]acl name test advance ?match-order Set ACL's match ordernumber Specify a number for the named ACL<cr>[Huawei]acl name test number ?INTEGER<2000-2999> Number of the basic named ACLINTEGER<42768-75535> Number of the advanced named ACL2.3、ACL类型配置[Huawei]acl ?INTEGER<1000-1999> Interface access-list(add to current using rules) # 接口访问列表aclINTEGER<10000-10999> Apply MPLS ACL # 应用MPLS ACLINTEGER<2000-2999> Basic access-list (add to current using rules) # 基本aclINTEGER<3000-3999> Advanced access-list(add to current using rules) # 高级aclINTEGER<4000-4999> MAC address access-list(add to current using rules) # 二层aclipv6 ACL IPv6 # 基本acl6和高级acl6配置name Specify a named ACLnumber Specify a numbered ACL2.4、ACL描述设置(可选)[Huawei-acl-basic-2600]description ?TEXT2.5、ACL步长设置(可选)[Huawei-acl-basic-test]step ?INTEGER<1-20> Specify value of step二、ACL类型规则配置1、基本ACL规则配置基本ACL编号acl-number的范围是2000~2999。

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

[Huawei-acl-basic-test]rule 1 ?deny Specify matched packet denypermit Specify matched packet permit[Huawei-acl-basic-test]rule 1 deny ?fragment-type Specify the fragment type of packet # 分组片段类型 source Specify source addresstime-range Specify a special timevpn-instance Specify a VPN-Instance<cr>[Huawei-acl-basic-test]rule 1 deny source ?X.X.X.X Address of sourceany Any source[Huawei-acl-basic-test]rule 1 deny source 192.168.1.1 ?0 Wildcard bits : 0.0.0.0 ( a host )X.X.X.X Wildcard of source[Huawei-acl-basic-test]rule 1 deny source 192.168.1.1 0 ?fragment-type Specify the fragment type of packet # 对分组片段类型有效time-range Specify a special time # 引用生效时间vpn-instance Specify a VPN-Instance # 用于vpn<cr>[Huawei-acl-basic-2600]description ? #配置规则描述TEXT ACL description (no more than 127 characters)在ACL中配置首条规则时,如果未指定参数rule-id,设备使用步长值作为规则的起始编号。

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

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

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

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

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

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

2、高级ACL规则配置高级ACL编号acl-number的范围是3000~3999。

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

[Huawei-acl-adv-3000]rule 1 permit ?<1-255> Protocol numbergre GRE tunneling(47)icmp Internet Control Message Protocol(1)igmp Internet Group Management Protocol(2)ip Any IP protocolipinip IP in IP tunneling(4)ospf OSPF routing protocol(89)tcp Transmission Control Protocol (6)udp User Datagram Protocol (17)[Huawei-acl-adv-3000]rule 1 permit udp ?destination Specify destination addressdestination-port Specify destination portdscp Specify dscpfragment-type Specify the fragment type of packetprecedence Specify precedencesource Specify source addresssource-port Specify source porttime-range Specify a special timetos Specify tosvpn-instance Specify a VPN-Instance<cr>[Huawei-acl-adv-3000]rule 1 permit udp source ?X.X.X.X Address of sourceany Any source[Huawei-acl-adv-3000]rule 1 permit udp source any ?destination Specify destination addressdestination-port Specify destination portdscp Specify dscpfragment-type Specify the fragment type of packetprecedence Specify precedencesource-port Specify source porttime-range Specify a special timetos Specify tosvpn-instance Specify a VPN-Instance<cr>[Huawei-acl-adv-3000]rule 1 permit udp source any des[Huawei-acl-adv-3000]rule 1 permit udp source any destination ? X.X.X.X Specify destination addressany Any destination IP address[Huawei-acl-adv-3000]rule 1 permit udp source any destination 192.168.1.1 ?0 Wildcard bits : 0.0.0.0 ( a host )X.X.X.X Wildcard of destination[Huawei-acl-adv-3000]rule 1 permit udp source any destination 192.168.1.1 0 ?destination-port Specify destination portdscp Specify dscpfragment-type Specify the fragment type of packetprecedence Specify precedencesource-port Specify source porttime-range Specify a special timetos Specify tosvpn-instance Specify a VPN-Instance<cr>[Huawei-acl-adv-3000]rule 1 permit udp source any destination 192.168.1.1 0 destination-port ?eq Equal to given port numbergt Greater than given port numberlt Less than given port numberneq Not equal to given port number # 不等于指定端口 range Between two port numbers[Huawei-acl-adv-3000]rule 1 permit udp source any destination 192.168.1.1 0 destination-port eq ?<0-65535> Protocol numberbiff Mail notify (512)bootpc Bootstrap Protocol Client (68)bootps Bootstrap Protocol Server (67)discard Discard (9)dns Domain Name Service (53)dnsix DNSIX Security Attribute Token Map (90) echo Echo (7)mobilip-ag MobileIP-Agent (434)mobilip-mn MobilIP-MN (435)nameserver Host Name Server (42)netbios-dgm NETBIOS Datagram Service (138)netbios-ns NETBIOS Name Service (137)netbios-ssn NETBIOS Session Service (139)ntp Network Time Protocol (123)rip Routing Information Protocol (520)snmp SNMP (161)snmptrap SNMPTRAP (162)sunrpc SUN Remote Procedure Call (111)syslog Syslog (514)tacacs-ds TACACS-Database Service (65)talk Talk (517)tftp Trivial File Transfer (69)time Time (37)who Who(513)xdmcp X Display Manager Control Protocol (177)[Huawei-acl-adv-3000]rule 1 permit udp source any destination 192.168.1.1 0 destination-port eq 21 ?dscp Specify dscpfragment-type Specify the fragment type of packetprecedence Specify precedencesource-port Specify source porttime-range Specify a special timetos Specify tosvpn-instance Specify a VPN-Instance<cr>高级acl 可以匹配的功能有:2.1、高级acl 常用协议数值对照表协议类型 数值ICMP 1IGMP 2IPinIP 4TCP 6UDP 17GRE 47IPOSPF 892.2、高级acl 常用功能说明参数 说明deny 拒绝符合条件的报文permit 允许符合条件的报文source{sour-addr sour-wildcard|any} sour-addr sour-wildcard:源ip 地址 源通配符掩码any :任意源IP 地址destination{dest-addr dest-wildcaard|any dest-addr dest-wildcaard :目的IP 地址及通配符掩码any :任意目的IP 地址icmp-type{icmp-name|icmp-type icmp-code} 指定acl 规则匹配报文的icmp 报文的类型和消息码信息,仅在报文协议是ICMP 的情况下有效precedence 指定acl 匹配报文时依据优先级字段进行过滤。

相关文档
最新文档