ACL实例
实施环境:真实设备H3C的防火墙和两台PC
1、要求:
现有一台H3C防火墙和两台PC,两台PC分别代表两个网络lan1和lan2,路由器分别连接这两个网络,要求lan1---->lan2 tcp 允许,lan2---->lan1 tcp 不允许。
2、网络拓扑图:
使用亿图工具绘制出网络拓扑图如图1所示:
图1:网络拓扑图
3、设备配置
(1)防火墙的配置
//进入配置模式
<H3C>sys
<H3C>system-view
System View: return to User View with Ctrl+Z.
[H3C]sysn
//修改名称
[H3C]sysname firewall
[firewall]int eth0/1
[firewall-Ethernet0/1]ip add
//配置IP配置
[firewall-Ethernet0/1]ip address 192.168.1.4 24
[firewall-Ethernet0/1]int eth0/4
[firewall-Ethernet0/4]ip add
[firewall-Ethernet0/4]ip address 192.168.2.1 24
//把eth0/4加入可信区域
[firewall]firewall zon
[firewall]firewall zone trust
[firewall-zone-trust]add interface eth0/4
//把eth0/1加入untrust区域
[firewall]firewall zon
[firewall]firewall zone untrust
[firewall-zone-untrust]add int eth0/1
//创建控制列表
[firewall]acl number 3000 match-order ?
[firewall]acl number 3000 match-order auto
//添加规则
[firewall-acl-adv-3000]rule 10 permit tcp source 192.168.1.0 0.0.0.255 destination 192.168.2.0 0.0.0.255 established
[firewall-acl-adv-3000]rule 20 deny ip source any destination any
//在接口上应用ACL
[firewall]int eth0/4
[firewall-Ethernet0/1]firewall packet-filter 3000 inbound
(2)PC1的配置
(3)PC2的配置
4、测试验证
(1)未配置ACL时telnet PC1
(2)未配置ACL时PC2远程PC1的结果如下图
(3)配置ACL后PC2远程PC1结果如下图:
(4)配置acl后PC2 telnet PC1结果如下图:
(5)配置acl后PC1 telnet PC2结果如下图
转载于:https://blog.51cto.com/tyjhz/1405477