配置ACL包过滤防火墙
组网需求
如图1所示,Router的接口Eth2/0/0连接一个高安全优先级的内部网络,接口GE3/0/0连接低安全优先级的外部网络,需要对内部网络和外部网络之间的通信实施包过滤。具体要求如下:
- 外部特定主机(10.39.2.3)允许访问内部网络中的服务器。
- 其余的访问均不允许。
图1 配置ACL包过滤组网图
配置思路
采用如下思路配置ACL包过滤防火墙:
-
配置安全区域和安全域间。
-
将接口加入安全区域。
-
配置ACL。
-
在安全域间配置基于ACL的包过滤。
操作步骤
- 在Router上配置安全区域和安全域间。
<Huawei> system-view [Huawei] firewall zone trust [Huawei-zone-trust] priority 14 [Huawei-zone-trust] quit [Huawei] firewall zone untrust [Huawei-zone-untrust] priority 1 [Huawei-zone-untrust] quit [Huawei] firewall interzone trust untrust [Huawei-interzone-trust-untrust] firewall enable [Huawei-interzone-trust-untrust] quit
- 在Router上将接口加入安全区域。
[Huawei] vlan 100 [Huawei-vlan100] quit [Huawei] interface vlanif 100 [Huawei-Vlanif100] ip address 10.38.1.1 24 [Huawei-Vlanif100] quit [Huawei] interface ethernet 2/0/0 [Huawei-Ethernet2/0/0] port link-type access [Huawei-Ethernet2/0/0] port default vlan 100 [Huawei-Ethernet2/0/0] quit [Huawei] interface vlanif 100 [Huawei-Vlanif100] zone trust [Huawei-Vlanif100] quit [Huawei] interface gigabitethernet 3/0/0 [Huawei-GigabitEthernet3/0/0] ip address 10.39.2.1 24 [Huawei-GigabitEthernet3/0/0] zone untrust [Huawei-GigabitEthernet3/0/0] quit
- 在Router上配置ACL。
[Huawei] acl 3102 [Huawei-acl-adv-3102] rule permit tcp source 10.39.2.3 0.0.0.0 destination 10.38.1.2 0.0.0.0 [Huawei-acl-adv-3102] rule permit tcp source 10.39.2.3 0.0.0.0 destination 10.38.1.3 0.0.0.0 [Huawei-acl-adv-3102] rule permit tcp source 10.39.2.3 0.0.0.0 destination 10.38.1.4 0.0.0.0 [Huawei-acl-adv-3102] rule deny ip [Huawei-acl-adv-3102] quit
- 在Router上配置包过滤。
[Huawei] firewall interzone trust untrust [Huawei-interzone-trust-untrust] packet-filter 3102 inbound [Huawei-interzone-trust-untrust] quit
- 验证配置结果。
配置成功后,仅特定主机(10.39.2.3)可以访问内部服务器。
在Router上执行display firewall interzone [ zone-name1 zone-name2 ]命令,结果如下。
[Huawei] display firewall interzone trust untrust interzone trust untrust firewall enable packet-filter default deny inbound packet-filter default permit outbound packet-filter 3102 inbound
配置文件文章来源:https://www.toymoban.com/news/detail-466621.html
Router的配置文件文章来源地址https://www.toymoban.com/news/detail-466621.html
# vlan batch 100 # acl number 3102 rule 5 permit tcp source 10.39.2.3 0 destination 10.38.1.2 0 rule 10 permit tcp source 10.39.2.3 0 destination 10.38.1.3 0 rule 15 permit tcp source 10.39.2.3 0 destination 10.38.1.4 0 rule 20 deny ip # interface Vlanif100 ip address 10.38.1.1 255.255.255.0 zone trust # firewall zone trust priority 14 # firewall zone untrust priority 1 # firewall interzone trust untrust firewall enable packet-filter 3102 inbound # interface Ethernet2/0/0 port link-type access port default vlan 100 # interface GigabitEthernet3/0/0 ip address 10.39.2.1 255.255.255.0 zone untrust # return
到了这里,关于配置ACL包过滤防火墙典型实验的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!