通过ensp模拟 高级ACl和静态路由
ACL常用的有基本acl , 范围是 2000到2999。高级acl 范围是 3000 到 3999 。基本acl只能匹配源ip地址,高级acl可以基于源IP、目标IP、协议类型(TCP/UDP/ICMP等)、端口号、服务等多维度条件进行匹配。
实验拓扑图

实验的目的
使用静态路由打通网络,使用高级 acl 禁止 vlan 10 访问 pc3。
配置
LWS1 配置
# LSW1
system-view
vlan batch 10 20 30
int g0/0/1
port link-type access
port default vlan 10
quit
int g0/0/2
port link-type access
port default vlan 20
quit
int g0/0/3
port link-type access
port default vlan 30
quit
int vlanif 10
ip address 192.168.10.254 24
quit
int vlanif 20
ip address 192.168.20.254 24
quit
int vlanif 30
ip address 192.168.30.254 24
quit
ip route-static 192.168.80.0 24 192.168.30.1
# 禁止 vlan10 区域和 pc3 通信
acl 3000
rule 5 deny ip source 192.168.10.0 0.0.0.255 destination 192.168.80.0 0.0.0.255
quit
int g0/0/1
traffic-filter inbound acl 3000
quit
路由器AR2的配置
# AR1
system-view
int g0/0/0
ip address 192.168.30.1 24
quit
int g0/0/1
ip address 192.168.80.254 24
quit
ip route-static 192.168.0.0 16 192.168.30.254
配置需要注意的地方
- pc的网关都是 x.x.x.254
- 配置在最近的接口,比如在路由器和交换机都可以配置,最好配置到交换机上。