华为-访问控制列表
Posted Jeffry Jiang
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了华为-访问控制列表相关的知识,希望对你有一定的参考价值。
标准访问列表格式:
acl <acl-number> [match-order config|auto] ;默认前者顺序匹配。
rule [normal|special]permit|deny [source source-addr source-wildcard|any]
例:
[Quidway]acl 10
[Quidway-acl-10]rule normal permit source 10.0.0.0 0.0.0.255
[Quidway-acl-10]rule normal deny source any
扩展访问控制列表配置命令
配置TCP/UDP协议的扩展访问列表:
rule normal|specialpermit|denytcp|udpsource <ip wild>|anydestination <ip wild>|any
[operate]
配置ICMP协议的扩展访问列表:
rule normal|specialpermit|denyicmp source <ip wild>|any]destination <ip wild>|any]
[icmp-code] [logging]
扩展访问控制列表操作符的含义
equal portnumber ;等于
greater-than portnumber ;大于
less-than portnumber ;小于
not-equal portnumber ;不等
range portnumber1 portnumber2 ;区间
扩展访问控制列表举例
[Quidway]acl 101
[Quidway-acl-101]rule deny souce any destination any
[Quidway-acl-101]rule permit icmp source any destination any icmp-type echo
[Quidway-acl-101]rule permit icmp source any destination any icmp-type echo-reply
[Quidway]acl 33
[Quidway-acl-33]rule permit ip source 10.0.0.1 0.0.0.0 destination 33.0.0.1 0.0.0.0
[Quidway-acl-33]rule deny ip source any destination any
[Quidway]acl 103
[Quidway-acl-103]rule permit tcp source any destination 10.0.0.1 0.0.0.0 destination-port equal ftp
[Quidway-acl-103]rule permit tcp source any destination 10.0.0.2 0.0.0.0 destination-port equal www
[Quidway]firewall enable
[Quidway]firewall default permit|deny
[Quidway]int e0
[Quidway-Ethernet0]firewall packet-filter 101 inbound|outbound
地址转换配置举例
[Quidway]firewall enable
[Quidway]firewall default permit
[Quidway]acl 101 ;内部指定主机可以进入e0
[Quidway-acl-101]rule deny ip source any destination any
[Quidway-acl-101]rule permit ip source 129.22.1.1 0 destination any
[Quidway-acl-101]rule permit ip source 129.22.1.2 0 destination any
[Quidway-acl-101]rule permit ip source 129.22.1.3 0 destination any
[Quidway-acl-101]rule permit ip source 129.22.1.4 0 destination any
[Quidway-acl-101]quit
[Quidway]int e0
[Quidway-Ethernet0]firewall packet-filter 101 inbound
[Quidway]acl 33 ;外部特定主机和大于334端口的数据包允许进入S0
[Quidway-acl-33]rule deny ip source any destination any
[Quidway-acl-33]rule permit tcp source 33.39.2.3 0 destination 33.22.23.1 0
[Quidway-acl-33]rule permit tcp source any destination 33.22.23.1 0 destination-port great-than
334
[Quidway-acl-33]quit
[Quidway]int s0
[Quidway-Serial0]firewall packet-filter 33 inbound ;设33.22.23.1是路由器出口IP。
[Quidway-Serial0]nat outbound 101 interface ;是Easy ip,将acl 101允许的IP从本接口出时变换源地址。
内部服务器地址转换配置命令(静态nat):
nat server global <ip> [port] inside <ip> port [protocol] ;global_port不写时使用inside_port
[Quidway-Serial0]nat server global 33.22.23.1 inside 129.22.1.1 ftp tcp
[Quidway-Serial0]nat server global 33.22.23.1 inside 129.22.1.2 telnet tcp
[Quidway-Serial0]nat server global 33.22.23.1 inside 129.22.1.3 www tcp
设有公网IP:33.22.23.101~33.22.23.103 可以使用。 ;对外访问(原例题)
[Quidway]nat address-group 33.22.23.101 33.22.23.103 pool1 ;建立地址池
[Quidway]acl 1
[Quidway-acl-1]rule permit source 10.110.10.0 0.0.0.255 ;指定允许的内部网络
[Quidway-acl-1]rule deny source any
[Quidway-acl-1]int serial 0
[Quidway-Serial0]nat outbound 1 address-group pool1 ;在s0口从地址池取出IP对外访问
[Quidway-Serial0]nat server global 33.22.23.101 inside 10.110.10.1 ftp tcp
[Quidway-Serial0]nat server global 33.22.23.33 inside 10.110.10.2 www tcp
[Quidway-Serial0]nat server global 33.22.23.33 8080 inside 10.110.10.3 www tcp
[Quidway-Serial0]nat server global 33.22.23.103 inside 10.110.10.4 smtp udp
以上是关于华为-访问控制列表的主要内容,如果未能解决你的问题,请参考以下文章