一、基本ACL
1.PC1不能ping通Server1
2.PC2可以ping通Server1
3.PC1可以ping通 PC2
R1配置
[R1]interface g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.100.254 24
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip address 192.168.1.254 24
[R1-GigabitEthernet0/0/1]int g0/0/2
[R1-GigabitEthernet0/0/2]ip address 192.168.2.254 24
[R1]acl 2000
[R1-acl-basic-2000]rule 5 deny source 192.168.1.1 0.0.0.0 //抓取这个IP流量并拒绝它
[R1]interface g0/0/0
[R1-GigabitEthernet0/0/0]traffic-filter outbound acl 2000 //相对于PC1来说在出接口上调用
验证配置效果
1.PC1不能ping通Server1
2.PC2可以ping通Server1
3.PC1可以ping通 PC2
二、高级ACL
1.允许Client1访问Server1的Web服务
2.允许Client1访问网络192.168.3.0/24
3.禁止Client1访问其它网络
R1配置
[R1]interface g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.254 24
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip address 12.1.1.1 24
[R1]ip route-static 0.0.0.0 0 12.1.1.2
[R1]acl 3000
[R1-acl-adv-3000]rule 5 permit tcp source 192.168.1.1 0 destination 192.168.2.1 0 destination-port eq 80
[R1-acl-adv-3000]rule 10 permit ip source 192.168.1.1 0 destination 192.168.3.0 0.0.0.255
[R1-acl-adv-3000]rule 15 deny ip source 192.168.1.1 0 destina