华为路由器防火墙配置命令总结(上)
一、access-list 用于创建访问规则。 (1)创建标准访问列表 access-list [ normal | special ] listnumber1 { permit | deny } source-addr [ source-mask ] (2)创建扩展访问列表 access-list [ normal | special ] listnumber2 { permit | deny } protoco
一、access-list 用于创建访问规则。(1)创建标准访问列表
access-list [ normal | special ] listnumber1 { permit | deny } source-addr [ source-mask ]
(2)创建扩展访问列表
access-list [ normal | special ] listnumber2 { permit | deny } protocol source-addr source-mask [ operator port1 [ port2 ] ] dest-addr dest-mask [ operator port1 [ port2 ] | icmp-type [ icmp-code ] ] [ log ]
(3)删除访问列表
no access-list { normal | special } { all | listnumber [ subitem ] }
【参数说明】
normal 指定规则加入普通时间段。
special 指定规则加入特殊时间段。
listnumber1 是1到99之间的一个数值,表示规则是标准访问列表规则。
listnumber2 是100到199之间的一个数值,表示规则是扩展访问列表规则。
permit 表明允许满足条件的报文通过。
deny 表明禁止满足条件的报文通过。
protocol 为协议类型,支持ICMP、TCP、UDP等,其它的协议也支持,此时没有端口比较的概念;为IP时有特殊含义,代表所有的IP协议。
source-addr 为源地址。
source-mask 为源地址通配位,在标准访问列表中是可选项,不输入则代表通配位为0.0.0.0。
dest-addr 为目的地址。
dest-mask 为目的地址通配位。
operator[可选] 端口操作符,在协议类型为TCP或UDP时支持端口比较,支持的比较操作有:等于(eq)、大于(gt)、小于(lt)、不等于(neq)或介于(range);如果操作符为range,则后面需要跟两个端口。
port1 在协议类型为TCP或UDP时出现,可以为关键字所设定的预设值(如telnet)或0~65535之间的一个数值。
port2 在协议类型为TCP或UDP且操作类型为range时出现;可以为关键字所设定的预设值(如telnet)或0~65535之间的一个数值。
icmp-type[可选] 在协议为ICMP时出现,代表ICMP报文类型;可以是关键字所设定的预设值(如echo-reply)或者是0~255之间的一个数值。
icmp-code在协议为ICMP且没有选择所设定的预设值时出现;代表ICMP码,是0~255之间的一个数值。
log [可选] 表示如果报文符合条件,需要做日志。
listnumber 为删除的规则序号,是1~199之间的一个数值。
subitem[可选] 指定删除序号为listnumber的访问列表中规则的序号。
【缺省情况】
系统缺省不配置任何访问规则。
【命令模式】
全局配置模式
【使用指南】
同一个序号的规则可以看作一类规则;所定义的规则不仅可以用来在接口上过滤报文,也可以被如DDR等用来判断一个报文是否是感兴趣的报文,此时,permit与deny表示是感兴趣的还是不感兴趣的。
使用协议域为IP的扩展访问列表来表示所有的IP协议。
同一个序号之间的规则按照一定的原则进行排列和选择,这个顺序可以通过 show access-list 命令看到。
【举例】
允许源地址为10.1.1.0 网络、目的地址为10.1.2.0网络的WWW访问,但不允许使用FTP。
Quidway(config)#access-list 100 permit tcp 10.1.1.0 0.0.0.255 10.1.2.0 0.0.0.255 eq www
Quidway(config)#access-list 100 deny tcp 10.1.1.0 0.0.0.255 10.1.2.0 0.0.0.255 eq ftp
【相关命令】
ip access-group
二、clear access-list counters 清除访问列表规则的统计信息。
clear access-list counters [ listnumber ]
【参数说明】
listnumber [可选] 要清除统计信息的规则的序号,如不指定,则清除所有的规则的统计信息。
【缺省情况】
任何时候都不清除统计信息。
【命令模式】
特权用户模式
【使用指南】
使用此命令来清除当前所用规则的统计信息,不指定规则编号则清除所有规则的统计信息。
【举例】
例1:清除当前所使用的序号为100的规则的统计信息。
Quidway#clear access-list counters 100
例2:清除当前所使用的所有规则的统计信息。
Quidway#clear access-list counters
【相关命令】
access-list
三、firewall 启用或禁止防火墙。
firewall { enable | disable }
【参数说明】
enable 表示启用防火墙。
disable 表示禁止防火墙。
【缺省情况】
系统缺省为禁止防火墙。
【命令模式】
全局配置模式
【使用指南】
使用此命令来启用或禁止防火墙,可以通过show firewall命令看到相应结果。如果采用了时间段包过滤,则在防火墙被关闭时也将被关闭;该命令控制防火墙的总开关。在使用 firewall disable 命令关闭防火墙时,防火墙本身的统计信息也将被清除。
【举例】
启用防火墙。
Quidway(config)#firewall enable
【相关命令】
access-list,ip access-group
四、firewall default 配置防火墙在没有相应的访问规则匹配时,缺省的过滤方式。
firewall default { permit | deny }
【参数说明】
permit 表示缺省过滤属性设置为“允许”。
deny 表示缺省过滤属性设置为“禁止”。
【缺省情况】
在防火墙开启的情况下,报文被缺省允许通过。
【命令模式】
全局配置模式
【使用指南】
当在接口应用的规则没有一个能够判断一个报文是否应该被允许还是禁止时,缺省的过滤属性将起作用;如果缺省过滤属性是“允许”,则报文可以通过,否则报文被丢弃。
【举例】
设置缺省过滤属性为“允许”。
Quidway(config)#firewall default permit
五、ip access-group 使用此命令将规则应用到接口上。使用此命令的no形式来删除相应的设置。
ip access-group listnumber { in | out }
[ no ] ip access-group listnumber { in | out }
【参数说明】
listnumber 为规则序号,是1~199之间的一个数值。
in 表示规则用于过滤从接口收上来的报文。
out 表示规则用于过滤从接口转发的报文。
【缺省情况】
没有规则应用于接口。
【命令模式】
接口配置模式。
【使用指南】
使用此命令来将规则应用到接口上;如果要过滤从接口收上来的报文,则使用 in 关键字;如果要过滤从接口转发的报文,使用out 关键字。一个接口的一个方向上最多可以应用20类不同的规则;这些规则之间按照规则序号的大小进行排列,序号大的排在前面,也就是优先级高。对报文进行过滤时,将采用发现符合的规则即得出过滤结果的方法来加快过滤速度。所以,建议在配置规则时,尽量将对同一个网络配置的规则放在同一个序号的访问列表中;在同一个序号的访问列表中,规则之间的排列和选择顺序可以用show access-list命令来查看。
【举例】
将规则101应用于过滤从以太网口收上来的报文。
Quidway(config-if-Ethernet0)#ip access-group 101 in
【相关命令】
access-list

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

According to a report from Smartprix, Xiaomi is developing a buttonless mobile phone codenamed "Suzaku". According to this news, this mobile phone codenamed Zhuque will be designed with an integrated concept, use an under-screen camera, and be equipped with Qualcomm Snapdragon 8gen4 processor. If the plan does not change, we are likely to see its arrival in 2025. When I saw this news, I thought I was back in 2019 - at that time, Xiaomi released the Mi MIX Alpha concept phone, and the surround-screen button-less design was quite amazing. This is the first time I have seen the charm of a buttonless mobile phone. If you want a piece of "magic glass", you must first kill the buttons. In "The Biography of Steve Jobs", Jobs once expressed that he hoped that the mobile phone could be like a piece of "magic glass".

On August 19, Hongmeng held a delivery ceremony for the first batch of Xiangjie S9 owners in Shanghai. Huawei executive Yu Chengdong personally attended and delivered the vehicles to the owners. At the scene, a car owner who already owned Wenjie M5, M7, and M9 asked Yu Chengdong when he could buy Huawei's three-fold screen mobile phone. Yu Chengdong responded that it would be available next month. Fenyefenye Previously, real shots of what appeared to be Huawei's three-fold screen phone had leaked on the Internet, causing widespread concern. In the picture, the new phone held by Yu Chengdong shows extraordinary visual impact. Its screen size is far larger than that of conventional folding screen mobile phones. It has a unique design and is not a tablet but is better than a tablet. There is a central hole-punch camera inlaid on the top of the left side, as well as a vaguely visible double-fold design. The side of the phone is suspected to be equipped with a stylus. These clues all point to this

Since the Huawei Mate60 series went on sale last year, I personally have been using the Mate60Pro as my main phone. In nearly a year, Huawei Mate60Pro has undergone multiple OTA upgrades, and the overall experience has been significantly improved, giving people a feeling of being constantly new. For example, recently, the Huawei Mate60 series has once again received a major upgrade in imaging capabilities. The first is the new AI elimination function, which can intelligently eliminate passers-by and debris and automatically fill in the blank areas; secondly, the color accuracy and telephoto clarity of the main camera have been significantly upgraded. Considering that it is the back-to-school season, Huawei Mate60 series has also launched an autumn promotion: you can enjoy a discount of up to 800 yuan when purchasing the phone, and the starting price is as low as 4,999 yuan. Commonly used and often new products with great value

Recently, Huawei announced that it will launch a new smart wearable product equipped with Xuanji sensing system in September, which is expected to be Huawei's latest smart watch. This new product will integrate advanced emotional health monitoring functions. The Xuanji Perception System provides users with a comprehensive health assessment with its six characteristics - accuracy, comprehensiveness, speed, flexibility, openness and scalability. The system uses a super-sensing module and optimizes the multi-channel optical path architecture technology, which greatly improves the monitoring accuracy of basic indicators such as heart rate, blood oxygen and respiration rate. In addition, the Xuanji Sensing System has also expanded the research on emotional states based on heart rate data. It is not limited to physiological indicators, but can also evaluate the user's emotional state and stress level. It supports the monitoring of more than 60 sports health indicators, covering cardiovascular, respiratory, neurological, endocrine,

According to news on August 16, for current Huawei mobile phones, they are already working hard to clear the way for the launch of new models, so everyone has seen the prices of the Mate60 series and Pura70 series being reduced one after another. With Huawei officially announcing price cuts for the Mate60 series on August 15, the latest models of Huawei’s two flagship series have completed price adjustments. In July this year, Huawei officially announced that the Huawei Pura70 series would be on sale, with prices reduced by up to 1,000 yuan. Among them, Huawei Pura70 has a direct discount of 500 yuan, with a starting price of 4999 yuan; Huawei Pura70 Beidou Satellite News Edition has a direct discount of 500 yuan, with a starting price of 5099 yuan; Huawei Pura70Pro has a direct discount of 800 yuan, with a starting price of 5699 yuan; Huawei Pura70Pr

According to news from this website on August 22, market research agency Pixalate released a report yesterday (August 21), stating that in the global mobile programmatic advertising market, Apple ranked first with a share of voice (SOV) of 51%. Explanation of related terms: This site briefly introduces the proper terms: Programmatic Advertising: Programmatic advertising refers to the use of advertising technology to purchase and sell digital advertising. Programmatic advertising can show your audience relevant ads through automated steps in less than a second. Share of Voice (SOV): Percentage of open programmatic ad sales related to specific device types in each region, as measured by Pixalate

On August 29, Huawei Terminal officially announced that the Huawei Pioneer Thanksgiving Feedback Season has begun! Buy Huawei MateX5, Huawei Pocket2, Huawei novaFlip, Huawei Pura70 series, and Huawei Mate60 series immediately to enjoy purchasing privileges. However, Huawei officials did not elaborate on the specific rights and interests of the "purchase privileges". 1. Huawei Mate , limited to 10 o'clock/16 o'clock/20 o'clock, order placed every hour

According to news on September 3, today, Huawei Terminal announced a new member of the Extraordinary Master series-MateXT. Huawei's Yu Chengdong forwarded this Weibo, and the mobile phone he used was the MateXT Extraordinary Master. It is reported that Mate Blogger Digital Chat Station hinted that the screen supplier for Huawei’s new MateXT Extraordinary Master product is BOE, which is also the first screen factory in the industry to mass-produce three-folding screens. Previously in August this year, Yu Chengdong was photographed using a three-fold screen mobile phone on an airplane. Judging from the exposed pictures, Huawei's three-fold screen mobile phone is very thin. Huawei three-fold screen mobile phone 1.
