实验名称: 简单的ACL流量控制实验 实验拓扑: 实验要求: sw1 是 vlan 10 20 网关 sw2 是 vlan 30 40 的网关 sw1与2 互相使用rip DNS服务器中配置 www.abc.com(192.168.30.88) 确保每个设备互通,且每个终端可以访问 www.abc.com(192.168.30.88) 之后: 1、pc-1与pc-2 之间的任何类型的流量都无法互通; 2、pC-3可以ping 192.168.30.88(web-server),但无法 ping www.abc.com 3、pc-4与pc-3之间的任何类型的流量都无法互通; 4、client-1 可以 ping www.abc.com , 但是无法通过自带的浏览器打开 server-2 中的 web 功能(即,www.abc.com)
实验配置:
设备端按图中的ip地址,网关地址为.254, dns:192.168.30.1
sw1
vlan batch 10 20 30 50
interface g0/0/1
port link-type access
port de vlan 30
interface g0/0/2
port link-type access
port de vlan 30
interface g0/0/12
port link-type trunk
port trunk a vlan 30 50
interface g0/0/13
port link-type trunk
port trunk a vlan 10 20
interface g0/0/14
port link-type trunk
port trunk a vlan 10 20
interface vlan 10
ip add 192.168.10.254 255.255.255.0
interface vlan 20
ip add 192.168.20.254 255.255.255.0
interface vlan 50
ip add 192.168.50.1 255.255.255.0
rip
version 2
network 192.168.10.0
network 192.168.20.0
network 192.168.30.0
sw2 vlan batch 30 40 50 interface g0/0/10 port link-type access port de vlan 40 interface g0/0/12 port link-type trunk port trunk a vlan 30 50 interface vlan 30 ip add 192.168.30.254 255.255.255.0 interface vlan 40 ip add 192.168.40.254 255.255.255.0 interface vlan 50 ip add 192.168.50.254 255.255.255.0 rip version 2 network 192.168.40.0
sw3 vlan batch 10 20 interface e0/0/1 port link-type access port de vlan 10 interface e0/0/2 port link-type access port de vlan 20 interface e0/0/13 port link-type trunk port trunk a vlan 10 20 interface e0/0/22 port link-type trunk port trunk a vlan 10 20 SW4 vlan batch 10 20 interface e0/0/3 port link-type access port de vlan 10 interface e0/0/14 port link-type trunk port trunk a vlan 10 20 interface e0/0/22 port link-type trunk port trunk a vlan 10 20
使所有设备互通,且都能访问www.ntd1807.com
之后:
1、
sw3 :
acl 3000
rule 5 deny ip source 192.168.10.10.0.0.0 destination 192.168.20.1 0.0.0.0
interface e0/0/2
traffic-filter onbound acl 3000
2、
sw4:
acl 3000
rule 5 deny ip source 192.168.30.1 0.0.0.0 destination 192.168.10.2 0.0.0.0
interface e0/0/3
traffic-filter outbound acl 3000
3、
sw5:
acl 3000
rule 5 deny ip source 192.168.10.2 0.0.0.0 destination 192.168.40.1 0.0.0.0
interface e0/0/4
traffic-filter outbound acl 3000
4、
sw5:
acl 3001
rule 15 deny tcp source 192.168.30.88 0.0.0.0 destination 192.168.40.3 0.0.0.0 destination-port eq 80
traffic-filter outbound acl 3001